Skip to content

Instantly share code, notes, and snippets.

@zuedev
Created November 10, 2025 01:59
Show Gist options
  • Select an option

  • Save zuedev/ce1823a13cee257d70709b68105a75dc to your computer and use it in GitHub Desktop.

Select an option

Save zuedev/ce1823a13cee257d70709b68105a75dc to your computer and use it in GitHub Desktop.
For OneDev: This Dockerfile downloads the image from the URL during build time and replaces `/app/site/assets/avatars/project.png` in the container.
FROM ubuntu:24.04 AS build
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://get.docker.com | sh
FROM ubuntu:24.04
ARG TARGETPLATFORM
ARG AVATAR_IMAGE_URL
COPY server-product/app /app
COPY server-product/docker/entrypoint-server.sh /root/bin/entrypoint.sh
RUN apt-get update && apt-get install -y locales iproute2 curl git git-lfs openjdk-17-jre-headless && rm -rf /var/lib/apt/lists/*
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# install docker
COPY --from=build /usr/bin/docker /usr/local/bin/docker
COPY --from=build /usr/libexec/docker/cli-plugins/docker-buildx /usr/libexec/docker/cli-plugins/docker-buildx
# install kubectl
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/${TARGETPLATFORM}/kubectl" && chmod +x kubectl && mv kubectl /usr/local/bin
# Replace project avatar if URL is provided
RUN if [ -n "$AVATAR_IMAGE_URL" ]; then \
curl -fsSL "$AVATAR_IMAGE_URL" -o /app/site/assets/avatars/project.png; \
fi
EXPOSE 6610
EXPOSE 6611
CMD ["/root/bin/entrypoint.sh"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment