feat: various modifications

- Default ubuntu user is removed
- Can add apt packages during image building with --apt-packages="list
  of pkg"
- Remove and/or prune podman image option
- Fix condition checks
This commit is contained in:
Ian
2026-10-04 15:42:03 +02:00
parent e95d6fa3bd
commit 35dcc67e6a
4 changed files with 39 additions and 65 deletions
+10 -4
View File
@@ -6,6 +6,8 @@ FROM ubuntu:${UBUNTU_VERSION}
ARG NODE_VERSION=24.21.0
ARG OPENCODE_VERSION=2.0.3
ARG EXTRA_APT_PACKAGES=""
ARG DEV_UID=1000
ARG DEV_GID=1000
@@ -49,16 +51,22 @@ RUN apt-get update \
zip \
&& update-alternatives --set java /usr/lib/jvm/java-17-openjdk-amd64/bin/java \
&& update-alternatives --set javac /usr/lib/jvm/java-17-openjdk-amd64/bin/javac \
&& rm -rf /var/lib/apt/lists/* \
&& echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen \
&& locale-gen \
&& ln -s "$(command -v fdfind)" /usr/local/bin/fd
RUN if [ -n "${EXTRA_APT_PACKAGES}" ]; then \
echo "Installing extra packages: ${EXTRA_APT_PACKAGES}" \
&& apt-get install -y --no-install-recommends ${EXTRA_APT_PACKAGES}; \
fi
RUN rm -rf /var/lib/apt/lists/*
COPY ./certs /usr/local/share/ca-certificates
RUN update-ca-certificates
ENV NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt
# Remove ubuntu user and create the dev one
# Remove ubuntu user and create the dev one with host uid and gid
RUN (userdel -r ubuntu 2>/dev/null || true) \
&& (groupdel ubuntu 2>/dev/null || true) \
&& groupadd --gid "${DEV_GID}" dev \
@@ -100,6 +108,4 @@ ENV HOME=/home/dev \
WORKDIR /workspace
ENTRYPOINT ["/usr/local/bin/opencode-dev-entrypoint"]
CMD ["bash"]