diff --git a/helpers/surfer/Dockerfile b/helpers/surfer/Dockerfile index d270666..607fc0e 100644 --- a/helpers/surfer/Dockerfile +++ b/helpers/surfer/Dockerfile @@ -1,4 +1,41 @@ -FROM node:lts-alpine -RUN apk add --no-cache make python3 zip +FROM node:lts as build # use --unsafe to not execute post actions as user nobody -RUN npm -g install cloudron-surfer@6.0.0 --unsafe && npm cache clean --force && surfer --version +RUN npm -g install cloudron-surfer@6.0.0 --unsafe && \ + npm cache clean --force && \ + surfer --version + +FROM build as distrobox +# Install essential packages and locales +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + apt-utils \ + bash \ + bash-completion \ + bc \ + curl \ + dialog \ + diffutils \ + findutils \ + gnupg2 \ + less \ + libegl1-mesa \ + libgl1-mesa-glx \ + libnss-myhostname \ + libvte-2.9*-common \ + libvte-common \ + libvulkan1 \ + locales \ + lsof \ + mesa-vulkan-drivers \ + ncurses-base \ + passwd \ + pinentry-curses \ + procps \ + sudo \ + time \ + tzdata \ + util-linux \ + wget + +# make sure that the distrobox stage is not the last one +FROM build as surfer \ No newline at end of file diff --git a/helpers/surfer/build.sh b/helpers/surfer/build.sh index ff106c8..e5150cf 100755 --- a/helpers/surfer/build.sh +++ b/helpers/surfer/build.sh @@ -19,6 +19,12 @@ else fi $CMD build . -t "$DOCKER_IMAGE:latest" +$CMD build . --target distrobox -t "$DOCKER_IMAGE:distrobox" + $CMD tag "$DOCKER_IMAGE:latest" "$DOCKER_IMAGE:$VERSION" -$CMD push "$DOCKER_IMAGE:latest" -$CMD push "$DOCKER_IMAGE:$VERSION" + +if [ "${1:-}" == "push" ]; then + $CMD push "$DOCKER_IMAGE:latest" + $CMD push "$DOCKER_IMAGE:$VERSION" + $CMD push "$DOCKER_IMAGE:distrobox" +fi \ No newline at end of file