This Docker image is built for my own purposes and is not an official made by Retype.
Since Retype is an executable binary built by .NET, the base image debian:bullseye-20211201-slim
is enough. The binary is downloaded and put in /usr/local/bin/retype
thus making it available in $PATH
.
The image does not set any specific directory as its working directory, you are free to choose where to put it. It's important to specify it via --workdir
.
It's important to also specify the --host 0.0.0.0
so that you can access from your browser to the web server running inside the container. Omitting this and you cannot access to the site.
# Suppose you are in ~/my-docs
~/my-docs$> docker run --rm --init \
-p 5000:5000 \
-v $(pwd):/opt/ \
--workdir /opt \
genzerhawker/retype:1.11.1 retype watch --host 0.0.0.0
A Compose file could save you all the details
services:
retype:
image: genzerhawker/retype:1.11.1
init: true
working_dir: /opt/
command: "retype watch --host 0.0.0.0"
ports:
- 5000:5000
volumes:
- ./:/opt/
Put this as docker-compose.yaml
in your document directory and docker compose up
.
It is possible to use this image in a multi-stage Dockerfile.
FROM genzerhawker/retype:1.11.1 as build
COPY . /opt/page
WORKDIR /opt/page/
RUN retype build
# This will be the final Docker image serving the static site.
# Feel free to choose whatever web server works for you.
FROM nginxinc/nginx-unprivileged:1.20.2 as final
COPY --from=build /opt/page/.retype/. /usr/share/nginx/html
I tried to use retype on Alpine but it didn't work, the process just hang forever.
It seems Alpine did not work well with dotnet-core (Retype is built by .NET).