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

Add Dockerfile for Arch Linux & use a more complicated WORKDIR #264

Merged
merged 4 commits into from
Feb 8, 2025
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
3 changes: 2 additions & 1 deletion docker/Dockerfile.alpine-latest
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ ARG UID=1000
ARG GID=1000
ARG ARCHIVE

WORKDIR /src
# Make it harder for libclang to find headers by coincidence
WORKDIR /path/to/src

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
Expand Down
26 changes: 26 additions & 0 deletions docker/Dockerfile.arch-latest
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM archlinux:latest

RUN pacman -Syu --noconfirm \
clang \
diffutils \
make \
python

ARG UID=1000
ARG GID=1000
ARG ARCHIVE

# Make it harder for libclang to find headers by coincidence
WORKDIR /path/to/src

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PYTEST_ADDOPTS "-p no:cacheprovider"

ADD ${ARCHIVE} .

RUN sh venv

ENV PATH=".venv/bin:${PATH}"

USER ${UID}:${GID}
3 changes: 2 additions & 1 deletion docker/Dockerfile.debian-bookworm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ ARG UID=1000
ARG GID=1000
ARG ARCHIVE

WORKDIR /src
# Make it harder for libclang to find headers by coincidence
WORKDIR /path/to/src

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
Expand Down
3 changes: 2 additions & 1 deletion docker/Dockerfile.debian-bullseye
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ ARG UID=1000
ARG GID=1000
ARG ARCHIVE

WORKDIR /src
# Make it harder for libclang to find headers by coincidence
WORKDIR /path/to/src

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
Expand Down
3 changes: 2 additions & 1 deletion docker/Dockerfile.debian-trixie
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ ARG UID=1000
ARG GID=1000
ARG ARCHIVE

WORKDIR /src
# Make it harder for libclang to find headers by coincidence
WORKDIR /path/to/src

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
Expand Down
3 changes: 2 additions & 1 deletion docker/Dockerfile.fedora-39
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ ARG UID=1000
ARG GID=1000
ARG ARCHIVE

WORKDIR /src
# Make it harder for libclang to find headers by coincidence
WORKDIR /path/to/src

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
Expand Down
3 changes: 2 additions & 1 deletion docker/Dockerfile.fedora-40
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ ARG UID=1000
ARG GID=1000
ARG ARCHIVE

WORKDIR /src
# Make it harder for libclang to find headers by coincidence
WORKDIR /path/to/src

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
Expand Down
3 changes: 2 additions & 1 deletion docker/Dockerfile.fedora-41
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ ARG UID=1000
ARG GID=1000
ARG ARCHIVE

WORKDIR /src
# Make it harder for libclang to find headers by coincidence
WORKDIR /path/to/src

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
Expand Down
3 changes: 2 additions & 1 deletion docker/Dockerfile.fedora-rawhide
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ ARG UID=1000
ARG GID=1000
ARG ARCHIVE

WORKDIR /src
# Make it harder for libclang to find headers by coincidence
WORKDIR /path/to/src

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
Expand Down
3 changes: 2 additions & 1 deletion docker/Dockerfile.ubuntu-latest
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ ARG UID=1000
ARG GID=1000
ARG ARCHIVE

WORKDIR /src
# Make it harder for libclang to find headers by coincidence
WORKDIR /path/to/src

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
Expand Down
10 changes: 9 additions & 1 deletion docker/Makefile.local
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,32 @@ $(HAWKMOTH_ARCHIVE): FORCE
@echo "error: git not available or not inside a git work tree" && false
endif

DOCKER_DISTROS := $(shell find $(docker_dir) -name 'Dockerfile.*' | sed 's/.*\.//' | sort)

# Containers for local testing
DOCKER_TEST_OUT_MOUNT = --mount type=bind,src=$(PWD)/doc/_build,dst=/out

hawkmoth-test.%: $(HAWKMOTH_ARCHIVE) FORCE
docker build --file $(docker_dir)/Dockerfile$(suffix $@) --build-arg UID=$(shell id -u) --build-arg GID=$(shell id -g) --build-arg ARCHIVE=$< --tag $@ .

docker-test-all: $(foreach distro,$(DOCKER_DISTROS),docker-test.$(distro)) FORCE

docker-test.%: hawkmoth-test.% FORCE
docker run $< make test

docker-check-all: $(foreach distro,$(DOCKER_DISTROS),docker-check.$(distro)) FORCE

docker-check.%: hawkmoth-test.% FORCE
docker run $< make check

docker-html-all: $(foreach distro,$(DOCKER_DISTROS),docker-html.$(distro)) FORCE

docker-html.%: hawkmoth-test.% FORCE
mkdir -p doc/_build
docker run $(DOCKER_TEST_OUT_MOUNT) $< make BUILDDIR=/out html

# Generate targets for auto-completion
$(shell find $(docker_dir) -name 'Dockerfile.*' | sed 's/.*\.\(.*\)/docker-test.\1 docker-check.\1 docker-html.\1/'):
$(foreach distro,$(DOCKER_DISTROS),docker-test.$(distro) docker-check.$(distro) docker-html.$(distro)):

FORCE:

Expand Down
Loading