Skip to content

Commit

Permalink
Dockerfile code improvements and labeles added.
Browse files Browse the repository at this point in the history
Dockerfile code improvements and labeles added.
The improvements include using bash as default shell
for bettter error detection while performing install
and start of container.

Signed-off-by: Milosz Linkiewicz <[email protected]>
  • Loading branch information
Mionsz committed Oct 7, 2024
1 parent 88f97d5 commit c908234
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
FROM alpine:3.18

# set version label
ARG BUILD_DATE
ARG VERSION
ARG WEBAPP_VERSION
LABEL build_version="netboot.xyz version: ${VERSION} Build-date: ${BUILD_DATE}"
LABEL maintainer="antonym"
ARG BUILD_DATE="10/7/2024"
ARG VERSION="0.7.3"
ARG WEBAPP_VERSION="0.7.3"

LABEL org.opencontainers.image.authors="[email protected]"
LABEL org.opencontainers.image.url="https://github.com/netbootxyz/webapp"
LABEL org.opencontainers.image.title="NetBoot.xyz WebApp"
LABEL org.opencontainers.image.description="NetBoot.xyz WebApp: A NodeJS helper application for managing local deployments of netboot.xyz"
LABEL org.opencontainers.image.documentation="https://netboot.xyz/docs/docker"
LABEL org.opencontainers.image.version="${WEBAPP_VERSION}"
LABEL org.opencontainers.image.vendor="https://NetBoot.xyz"
LABEL org.opencontainers.image.licenses="Apache-2.0 license"

RUN apk add --no-cache bash
SHELL ["/bin/bash", "-e", "-o", "pipefail", "-c"]

RUN \
apk upgrade --no-cache && \
Expand All @@ -26,15 +36,13 @@ RUN \
supervisor \
syslog-ng \
tar \
tftp-hpa

RUN \
tftp-hpa && \
groupmod -g 1000 users && \
useradd -u 911 -U -d /config -s /bin/false nbxyz && \
usermod -G users nbxyz && \
mkdir /app \
/config \
/defaults
/defaults

COPY . /app

Expand All @@ -43,10 +51,12 @@ RUN \

ENV TFTPD_OPTS=''

EXPOSE 3000
EXPOSE 8080
EXPOSE 69/UDP 80/TCP 3000/TCP 8080/TCP
VOLUME ["/assets", "/config"]

COPY root/ /
CMD ["/start.sh"]
SHELL ["/bin/bash", "-c"]

# default command
CMD ["sh","/start.sh"]
ENTRYPOINT ["/start.sh"]

0 comments on commit c908234

Please sign in to comment.