Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include developer tools in development Docker image #374

Merged
merged 2 commits into from
Nov 22, 2023
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
- cron: '30 4 * * MON'
env:
DEBIAN_FRONTEND: noninteractive
NO_DOCUMENTATION: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.draft == true }}
DOCKER_DEV_IMAGE: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.draft == true }}
jobs:
shellcheck:
name: Style check (Bash)
Expand Down
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ Documentation:
- In `README.md`, add a link to a GPT chatbot with background knowledge about
the Markdown Package for TeX. (59eb04d)

Docker:

- Include developer tools in the development Docker image. (#374)

## 3.2.0 (2023-10-21)

Development:
Expand Down
18 changes: 15 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,18 @@ ARG DEPENDENCIES="\
zip \
"

ARG DEV_DEPENDENCIES="\
less \
vim \
"

ARG BINARY_DIR=/usr/local/bin
ARG BUILD_DIR=/git-repo
ARG INSTALL_DIR=/usr/local/texlive/texmf-local

ARG FROM_IMAGE=texlive/texlive
ARG TEXLIVE_TAG=latest
ARG NO_DOCUMENTATION=false
ARG DEV_IMAGE=false

FROM $FROM_IMAGE:$TEXLIVE_TAG as build

Expand All @@ -44,7 +49,7 @@ ARG DEPENDENCIES
ARG BUILD_DIR
ARG INSTALL_DIR

ARG NO_DOCUMENTATION
ARG DEV_IMAGE

ENV DEBIAN_FRONTEND=noninteractive
ENV TERM=xterm
Expand Down Expand Up @@ -90,7 +95,7 @@ mtxrun --generate
texhash

# Produce the complete distribution archive of the Markdown package
make -C ${BUILD_DIR} dist NO_DOCUMENTATION=${NO_DOCUMENTATION}
make -C ${BUILD_DIR} dist NO_DOCUMENTATION=${DEV_IMAGE}
mkdir ${BUILD_DIR}/dist
unzip ${BUILD_DIR}/markdown.tds.zip -d ${BUILD_DIR}/dist

Expand All @@ -101,11 +106,14 @@ FROM $FROM_IMAGE:$TEXLIVE_TAG

ARG AUXILIARY_FILES
ARG DEPENDENCIES
ARG DEV_DEPENDENCIES

ARG BINARY_DIR
ARG BUILD_DIR
ARG INSTALL_DIR

ARG DEV_IMAGE

LABEL authors="Vít Starý Novotný <witiko@mail.muni.cz>"

ENV DEBIAN_FRONTEND=noninteractive
Expand Down Expand Up @@ -133,6 +141,10 @@ chmod +x ${BINARY_DIR}/markdown-cli
# Install dependencies, but this time we clean up after ourselves
apt-get -qy update
apt-get -qy install --no-install-recommends ${DEPENDENCIES}
if [ ${DEV_IMAGE} = true ]
then
apt-get -qy install --no-install-recommends ${DEV_DEPENDENCIES}
fi
apt-get -qy autoclean
apt-get -qy clean
apt-get -qy autoremove --purge
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ LASTMODIFIED=$(shell git log -1 --date=format:%Y-%m-%d --format=%ad)
ifndef DOCKER_TEXLIVE_TAG
DOCKER_TEXLIVE_TAG=latest
endif
ifeq ($(NO_DOCUMENTATION), true)
ifeq ($(DOCKER_DEV_IMAGE), true)
DOCKER_TAG_POSTFIX=-no_docs
endif
DOCKER_TEMPORARY_IMAGE=ghcr.io/witiko/markdown
Expand All @@ -88,7 +88,7 @@ base: $(INSTALLABLES) $(LIBRARIES)
docker-image:
docker pull $(DOCKER_TEMPORARY_IMAGE):$(DOCKER_TEMPORARY_TAG) || \
DOCKER_BUILDKIT=1 docker build --pull --build-arg TEXLIVE_TAG=$(DOCKER_TEXLIVE_TAG) \
--build-arg NO_DOCUMENTATION=$(NO_DOCUMENTATION) \
--build-arg DEV_IMAGE=$(DOCKER_DEV_IMAGE) \
-t $(DOCKER_TEMPORARY_IMAGE):$(DOCKER_TEMPORARY_TAG) .

# This pseudo-targed pushes the built witiko/markdown Docker image to
Expand Down