Skip to content

Commit 5d183a0

Browse files
authored
Switch base image from Alpine to Debian (#5257)
1 parent 50a04fb commit 5d183a0

File tree

4 files changed

+42
-13
lines changed

4 files changed

+42
-13
lines changed

Dockerfile

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,37 @@
1-
# Install CFSSL from official cfssl.org binaries
2-
FROM cfssl/cfssl:1.5.0 AS cfssl
1+
# Need to use version number so that it gets updated here and triggers a build
2+
# Find the current version of Python at https://www.python.org/downloads/source/
3+
ARG PYTHON_VERSION=3.11.9
4+
ARG DEBIAN_CODENAME=bookworm
5+
6+
FROM python:${PYTHON_VERSION}-slim-${DEBIAN_CODENAME}
7+
8+
ENV LC_ALL=C.UTF-8
9+
ENV PS1="(deb) \w \$ "
10+
11+
RUN apt-get update && \
12+
apt-get -y -q install bash ruby ruby-dev rubygems build-essential curl git zip bzip2 jq wget sudo
13+
# https://github.com/jordansissel/fpm/issues/1663
14+
RUN gem install --no-document backports -v 3.15.0
15+
RUN gem install --no-document fpm
16+
17+
ARG GO_INSTALL_VERSION=1.23.2
18+
ARG TARGETARCH
19+
20+
# Install go
21+
RUN echo downloading go${GO_INSTALL_VERSION} && \
22+
curl -sSL --retry 3 -o golang.tar.gz https://golang.org/dl/go${GO_INSTALL_VERSION}.linux-${TARGETARCH}.tar.gz && \
23+
tar xzf golang.tar.gz && \
24+
mv go /usr/lib/ && rm golang.tar.gz && \
25+
ln -s /usr/lib/go/bin/go /usr/bin/go
326

4-
# Install remaining packages
5-
FROM alpine:3.16.2
627
ENV INSTALL_PATH=/packages/bin
728
ENV PATH=${INSTALL_PATH}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
829
RUN mkdir -p ${INSTALL_PATH}
9-
RUN apk add --update --no-cache bash make curl coreutils libc6-compat tar xz jq sudo go
10-
11-
COPY --from=cfssl /go/bin/ ${INSTALL_PATH}/
12-
13-
COPY bin/ /usr/local/bin/
1430

1531
COPY . /packages
1632
RUN mkdir -p /packages/tmp
1733
RUN make -C /packages/install/ all
34+
1835
WORKDIR /packages
36+
ENTRYPOINT ["/bin/bash"]
37+
CMD ["-l"]

deb/Dockerfile.stable-slim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,7 @@ RUN echo downloading go${GO_INSTALL_VERSION} && \
2626

2727

2828
WORKDIR /packages
29+
30+
# Our base image is Python, with entrypoint into a Python shell, so we need to override the entrypoint
31+
ENTRYPOINT ["/bin/bash"]
32+
CMD ["-l"]

vendor/cfssl/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ export PACKAGE_REPO_NAME = cfssl
66
export DOWNLOAD_URL = $(PACKAGE_REPO_URL)/releases/download/v$(PACKAGE_VERSION)/$(PACKAGE_NAME)_$(PACKAGE_VERSION)_$(OS)_$(ARCH)
77
export APK_BUILD_TEMPLATE ?= APKBUILD.github-binary
88

9-
# arm64 not supported
10-
export PACKAGE_ARCHS_DISABLED = arm64
9+
# arm64 not supported on MacOS, but OK to install AMD64 version
10+
ifeq ($(OS),darwin)
11+
ARCH = amd64
12+
endif
13+
# export PACKAGE_ARCHS_DISABLED = arm64
1114

1215
install:
1316
$(call download_binary)

vendor/cfssljson/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ export PACKAGE_REPO_NAME = cfssl
77
export DOWNLOAD_URL = $(PACKAGE_REPO_URL)/releases/download/v$(PACKAGE_VERSION)/$(PACKAGE_NAME)_$(PACKAGE_VERSION)_$(OS)_$(ARCH)
88
export APK_BUILD_TEMPLATE ?= APKBUILD.github-binary
99

10-
# arm64 not supported
11-
export PACKAGE_ARCHS_DISABLED = arm64
10+
# arm64 not supported on MacOS, but OK to install AMD64 version
11+
ifeq ($(OS),darwin)
12+
ARCH = amd64
13+
endif
14+
# export PACKAGE_ARCHS_DISABLED = arm64
1215

1316
install:
1417
$(call download_binary)

0 commit comments

Comments
 (0)