Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/keenwrite.git

Run ConTeXt after creating container

AuthorDaveJarvis <email>
Date2022-09-05 10:41:11 GMT-0700
Commit6d28bf2e83e994054678d1d238c24924f17359bf
Parent1ed0ff3
Delta24 lines added, 6 lines removed, 18-line increase
Containerfile
# Unpack fonts (prior to ConTeXt).
RUN unzip -j -o roboto.zip "*.ttf"
-RUN unzip -j -o inconsolata.zip "*.ttf"
+RUN unzip -j -o inconsolata.zip "**/Inconsolata/*.ttf"
RUN unzip -j -o source-serif.zip "source-serif-4.004/OTF/SourceSerif4-*.otf"
RUN unzip -j -o archivo-narrow.zip "Archivo-Narrow/otf/*.otf"
RUN echo "export PATH=\"\$PATH:\$CONTEXT_HOME/tex/texmf-linuxmusl/bin\"" >> $PROFILE
RUN echo "export OSFONTDIR=\"/usr/share/fonts//\""
-RUN echo "PS1=\"docker:\\w\\\$ \\"" >> $PROFILE
+RUN echo "PS1=\"typesetter:\\w\\\$ \"" >> $PROFILE
# Trim the fat.
RUN source $PROFILE
RUN rm -rf $CONTEXT_HOME/tex/texmf-context/doc
RUN find . -type f -name "*.pdf" -exec rm {} \;
# Prepare to process text files.
WORKDIR "/root"
-
-ENTRYPOINT ["/bin/sh"]
context-container.sh
#!/usr/bin/env bash
+if [ -z ${IMAGES_DIR} ]; then
+ echo "Set IMAGES_DIR"
+ exit 10
+fi
+
+readonly CONTAINER_NAME=typesetter
+
# Force clean
podman rmi --all --force
# Build from Containerfile
-podman build --tag context .
+podman build --tag ${CONTAINER_NAME} .
+
+# Connect and mount images
+podman run \
+ --rm \
+ -i \
+ -v ${IMAGES_DIR}:/root/images:ro \
+ -t ${CONTAINER_NAME} \
+ /bin/sh --login -c 'context --version'
+
+# Create a persistent container
+# podman create typesetter typesetter
+
+# Create a long-running task
+# podman create -ti typesetter /bin/sh
# Connect
-podman run --rm -i -t localhost/context --login
# Export