fix permission issues with the tftp volume

This commit is contained in:
Matthias Hemmerich 2023-07-21 12:57:51 +02:00
parent eaaf9da1d9
commit d0c6d9e9f2
3 changed files with 23 additions and 14 deletions

3
.env Normal file
View file

@ -0,0 +1,3 @@
COMPOSE_PROJECT_NAME=pxe-stack
# this repo will be cloned on every restart of the container
GIT_REPO_URL=https://git.mailbro.de/angestoepselt/LinuxPXE.git

View file

@ -24,6 +24,14 @@ services:
start_period: 20s
timeout: 10s
git-init:
image: codeberg.org/angestoepselt/git-alpine:latest
security_opt:
- no-new-privileges:true
container_name: git-init
volumes:
- tftp-data:/git
nginx:
<<: *common-keys-core # see variables at the top of the yml file
image: nginx:mainline-alpine3.17-slim
@ -48,19 +56,10 @@ services:
- "69:69/udp"
volumes:
- tftp-data:/var/tftp
depends_on:
- git-init
# this image has a build in healthcheck
git-init:
image: codeberg.org/angestoepselt/git-alpine:latest
security_opt:
- no-new-privileges:true
container_name: git-init
volumes:
- tftp-data:/git
environment:
# this repo will be cloned on every restart of the container
- GIT_REPO_URL=https://git.mailbro.de/angestoepselt/LinuxPXE.git
volumes:
cache:
config:

View file

@ -9,14 +9,21 @@ ENV ADDR="127.0.0.1" \
RUN apk update ; \
apk upgrade ; \
apk add --no-cache --update tftp-hpa ; \
rm /var/cache/apk/*
VOLUME /var/tftp
rm /var/cache/apk/* \
; \
adduser -D -u 1000 non-privileged ; \
mkdir $ROOT ; \
chown -R 1000:1000 $ROOT
VOLUME $ROOT
EXPOSE 69/udp
COPY tftp.conf /etc/init/
# Switch to the non-privileged user
USER 1000
ENTRYPOINT ["in.tftpd"]
CMD ["-Lv", "-s", "/var/tftp"]