Dockerfile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. FROM alpine:3.20
  2. # set version label
  3. ARG BUILD_DATE
  4. ARG VERSION
  5. ARG WEBAPP_VERSION
  6. LABEL build_version="netboot.xyz version: ${VERSION} Build-date: ${BUILD_DATE}"
  7. LABEL maintainer="antonym"
  8. LABEL org.opencontainers.image.description netboot.xyz official docker container - Your favorite operating systems in one place. A network-based bootable operating system installer based on iPXE.
  9. RUN \
  10. apk add --no-cache \
  11. bash \
  12. busybox \
  13. curl \
  14. envsubst \
  15. git \
  16. jq \
  17. nghttp2-dev \
  18. nginx \
  19. nodejs \
  20. shadow \
  21. sudo \
  22. supervisor \
  23. syslog-ng \
  24. tar \
  25. tftp-hpa && \
  26. apk add --no-cache --virtual=build-dependencies \
  27. npm && \
  28. groupmod -g 1000 users && \
  29. useradd -u 911 -U -d /config -s /bin/false nbxyz && \
  30. usermod -G users nbxyz && \
  31. mkdir /app \
  32. /config \
  33. /defaults && \
  34. if [ -z ${WEBAPP_VERSION+x} ]; then \
  35. WEBAPP_VERSION=$(curl -sX GET "https://api.github.com/repos/netbootxyz/webapp/releases/latest" \
  36. | awk '/tag_name/{print $4;exit}' FS='[""]'); \
  37. fi && \
  38. curl -o /tmp/webapp.tar.gz -L \
  39. "https://github.com/netbootxyz/webapp/archive/${WEBAPP_VERSION}.tar.gz" && \
  40. tar xf /tmp/webapp.tar.gz -C \
  41. /app/ --strip-components=1 && \
  42. npm install --prefix /app && \
  43. apk del --purge build-dependencies && \
  44. rm -rf /tmp/*
  45. ENV TFTPD_OPTS=''
  46. ENV NGINX_PORT='80'
  47. ENV WEB_APP_PORT='3000'
  48. EXPOSE 69/udp
  49. EXPOSE 80
  50. EXPOSE 3000
  51. COPY root/ /
  52. # default command
  53. CMD ["sh","/start.sh"]