Skip to content

Commit

Permalink
Add a mechanism for getting files placed in tftp root
Browse files Browse the repository at this point in the history
Useful for raspberry pi 4
  • Loading branch information
kalaksi committed Jul 26, 2020
1 parent 98fcad2 commit 586bfe4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ RUN apk add --no-cache --virtual syslinux_with_deps syslinux && \
ln -s ../pxelinux.cfg /tftpboot/syslinux/pxelinux.cfg && \
apk del syslinux_with_deps

# Default configuration that can be overridden
COPY pxelinux.cfg /tftpboot/pxelinux.cfg

EXPOSE 1069/udp
Expand All @@ -26,5 +27,8 @@ VOLUME /tftpboot/boot
# The daemon doesn't seem to work if container is not run as root, but it still drops the root
# privileges with the -u option.
# Note that the main process still runs as root, but files are being served as non-root.
ENTRYPOINT ["in.tftpd"]
CMD ["-L", "-vvv", "-u", "ftp", "--secure", "--address", "0.0.0.0:1069", "/tftpboot"]
CMD set -eu ;\
# Some devices such as the Raspberry Pi 4 expect files to be available directly in the TFTP root, so
# use a boot directory with the special name "root" to have it's contents copied to the TFTP root directory.
[ -d /tftpboot/boot/root ] && cp -a /tftpboot/boot/root/* /tftpboot ;\
exec in.tftpd -L -vvv -u ftp --secure --address 0.0.0.0:1069 /tftpboot
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This container runs a TFTP server with a prepopulated ```/tftpboot``` directory
### Why use this container?
**Simply put, this container has been written with simplicity and security in mind.**

Surprisingly, _many_ community containers run unnecessarily with root privileges by default and don't provide help for dropping unneeded CAPabilities either.
Many community containers run unnecessarily with root privileges by default and don't provide help for dropping unneeded CAPabilities either.
Additionally, overly complex shell scripts and unofficial base images make it harder to verify the source and keep images up-to-date.

To remedy the situation, these images have been written with security, simplicity and overall quality in mind.
Expand Down

0 comments on commit 586bfe4

Please sign in to comment.