Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,14 @@ RUN wget https://github.com/mathjax/MathJax/archive/refs/tags/3.2.2.zip -O tmp.z
rm -f tmp.zip

# Pandoc
RUN wget https://github.com/jgm/pandoc/releases/download/2.19.2/pandoc-2.19.2-1-amd64.deb -O tmp.deb && \
RUN ARCH=$(dpkg --print-architecture) && \
if [ "$ARCH" = "amd64" ]; then \
wget https://github.com/jgm/pandoc/releases/download/3.8.2/pandoc-3.8.2-1-amd64.deb -O tmp.deb; \
elif [ "$ARCH" = "arm64" ]; then \
wget https://github.com/jgm/pandoc/releases/download/3.8.2/pandoc-3.8.2-1-arm64.deb -O tmp.deb; \
else \
echo "Unsupported architecture: $ARCH" && exit 1; \
fi && \
dpkg -i tmp.deb && \
rm -f tmp.deb

Expand Down
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
IMAGE_ROOT?=ghcr.io/csc-training
IMAGE=slidefactory
IMAGE_VERSION?=$(shell grep -m1 -oP '(?<=VERSION = ").+(?=")' slidefactory.py)

IMAGE_VERSION=$(shell grep -m1 'VERSION = "' slidefactory.py | sed -E 's/.*VERSION = "(.*)".*/\1/')
CONTAINER_CMD=$(shell command -v podman >/dev/null 2>&1 && echo podman || echo docker)

build: Dockerfile slidefactory.py
docker build \
${CONTAINER_CMD} build \
--platform "linux/amd64,linux/arm64" \
--label "org.opencontainers.image.source=https://github.com/csc-training/slidefactory" \
--label "org.opencontainers.image.description=slidefactory" \
--build-arg VERSION=${IMAGE_VERSION} \
-t ${IMAGE_ROOT}/${IMAGE}:${IMAGE_VERSION} \
.

push:
docker push ${IMAGE_ROOT}/${IMAGE}:${IMAGE_VERSION}
${CONTAINER_CMD} push ${IMAGE_ROOT}/${IMAGE}:${IMAGE_VERSION}

singularity:
rm -f $(IMAGE).sif $(IMAGE).tar
docker save $(IMAGE_ROOT)/$(IMAGE):$(IMAGE_VERSION) -o $(IMAGE).tar
${CONTAINER_CMD} save $(IMAGE_ROOT)/$(IMAGE):$(IMAGE_VERSION) -o $(IMAGE).tar
singularity build $(IMAGE).sif docker-archive://$(IMAGE).tar
rm -f $(IMAGE).tar

Expand Down