Skip to content

Commit

Permalink
Change base of published Docker image from Alpine to Debian
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuru committed Dec 9, 2024
1 parent b58d445 commit c17dca2
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 9 deletions.
37 changes: 28 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,37 @@
# Install CFSSL from official cfssl.org binaries
FROM cfssl/cfssl:1.5.0 AS cfssl
# Need to use version number so that it gets updated here and triggers a build
# Find the current version of Python at https://www.python.org/downloads/source/
ARG PYTHON_VERSION=3.11.9
ARG DEBIAN_CODENAME=bookworm

FROM python:${PYTHON_VERSION}-slim-${DEBIAN_CODENAME}

ENV LC_ALL=C.UTF-8
ENV PS1="(deb) \w \$ "

RUN apt-get update && \
apt-get -y -q install bash ruby ruby-dev rubygems build-essential curl git zip bzip2 jq wget sudo
# https://github.com/jordansissel/fpm/issues/1663
RUN gem install --no-document backports -v 3.15.0
RUN gem install --no-document fpm

ARG GO_INSTALL_VERSION=1.23.2
ARG TARGETARCH

# Install go
RUN echo downloading go${GO_INSTALL_VERSION} && \
curl -sSL --retry 3 -o golang.tar.gz https://golang.org/dl/go${GO_INSTALL_VERSION}.linux-${TARGETARCH}.tar.gz && \
tar xzf golang.tar.gz && \
mv go /usr/lib/ && rm golang.tar.gz && \
ln -s /usr/lib/go/bin/go /usr/bin/go

# Install remaining packages
FROM alpine:3.16.2
ENV INSTALL_PATH=/packages/bin
ENV PATH=${INSTALL_PATH}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RUN mkdir -p ${INSTALL_PATH}
RUN apk add --update --no-cache bash make curl coreutils libc6-compat tar xz jq sudo go

COPY --from=cfssl /go/bin/ ${INSTALL_PATH}/

COPY bin/ /usr/local/bin/

COPY . /packages
RUN mkdir -p /packages/tmp
RUN make -C /packages/install/ all

WORKDIR /packages
ENTRYPOINT ["/bin/bash"]
CMD ["-l"]
4 changes: 4 additions & 0 deletions deb/Dockerfile.stable-slim
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ RUN echo downloading go${GO_INSTALL_VERSION} && \


WORKDIR /packages

# Our base image is Python, with entrypoint into a Python shell, so we need to override the entrypoint
ENTRYPOINT ["/bin/bash"]
CMD ["-l"]

0 comments on commit c17dca2

Please sign in to comment.