Dockerfiles: switch base image from alpine to Debian

We've had a lot of issues with alpine and currently there's a broken
network issue on alpine for users running on RPI arm32 architechture
which requires a workaround before docker is able to sync time between
the host and the container: https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.13.0\#time64_requirements.

Since we're switching the base image of the storagenode to debian,
it's best to switch the base image of all our docker images to
debian as well for consistency; less drift across them and keeps
the push target consistent.

Change-Id: If3adf7a57dc59f19ef2221b892f340d919798fc5
This commit is contained in:
Clement Sam 2022-03-25 08:18:58 +00:00
parent ee7f0d3a2a
commit e486585853
7 changed files with 28 additions and 26 deletions

View File

@ -197,8 +197,8 @@ images: multinode-image satellite-image storagenode-image versioncontrol-image #
multinode-image: multinode_linux_arm multinode_linux_arm64 multinode_linux_amd64 ## Build multinode Docker image
${DOCKER_BUILD} --pull=true -t storjlabs/multinode:${TAG}${CUSTOMTAG}-amd64 \
-f cmd/multinode/Dockerfile .
${DOCKER_BUILD} --pull=true -t storjlabs/multinode:${TAG}${CUSTOMTAG}-arm32v6 \
--build-arg=GOARCH=arm --build-arg=DOCKER_ARCH=arm32v6 \
${DOCKER_BUILD} --pull=true -t storjlabs/multinode:${TAG}${CUSTOMTAG}-arm32v5 \
--build-arg=GOARCH=arm --build-arg=DOCKER_ARCH=arm32v5 \
-f cmd/multinode/Dockerfile .
${DOCKER_BUILD} --pull=true -t storjlabs/multinode:${TAG}${CUSTOMTAG}-arm64v8 \
--build-arg=GOARCH=arm64 --build-arg=DOCKER_ARCH=arm64v8 \
@ -208,8 +208,8 @@ multinode-image: multinode_linux_arm multinode_linux_arm64 multinode_linux_amd64
satellite-image: satellite_linux_arm satellite_linux_arm64 satellite_linux_amd64 ## Build satellite Docker image
${DOCKER_BUILD} --pull=true -t storjlabs/satellite:${TAG}${CUSTOMTAG}-amd64 \
-f cmd/satellite/Dockerfile .
${DOCKER_BUILD} --pull=true -t storjlabs/satellite:${TAG}${CUSTOMTAG}-arm32v6 \
--build-arg=GOARCH=arm --build-arg=DOCKER_ARCH=arm32v6 \
${DOCKER_BUILD} --pull=true -t storjlabs/satellite:${TAG}${CUSTOMTAG}-arm32v5 \
--build-arg=GOARCH=arm --build-arg=DOCKER_ARCH=arm32v5 \
-f cmd/satellite/Dockerfile .
${DOCKER_BUILD} --pull=true -t storjlabs/satellite:${TAG}${CUSTOMTAG}-arm64v8 \
--build-arg=GOARCH=arm64 --build-arg=DOCKER_ARCH=arm64v8 \
@ -221,7 +221,7 @@ storagenode-image: ## Build storagenode Docker image
--build-arg=GOARCH=amd64 \
-f cmd/storagenode/Dockerfile .
${DOCKER_BUILD} --pull=true -t storjlabs/storagenode:${TAG}${CUSTOMTAG}-arm32v5 \
--build-arg=GOARCH=arm --build-arg=DOCKER_ARCH=arm32v5 --build-arg=DOCKER_PLATFORM=linux/arm/v6 \
--build-arg=GOARCH=arm --build-arg=DOCKER_ARCH=arm32v5 --build-arg=DOCKER_PLATFORM=linux/arm/v5 \
-f cmd/storagenode/Dockerfile .
${DOCKER_BUILD} --pull=true -t storjlabs/storagenode:${TAG}${CUSTOMTAG}-arm64v8 \
--build-arg=GOARCH=arm64 --build-arg=DOCKER_ARCH=arm64v8 --build-arg=DOCKER_PLATFORM=linux/arm64 \
@ -249,7 +249,7 @@ push-storagenode-base-image: ## Push the storagenode base image to dockerhub
docker manifest push --purge storjlabs/storagenode-base:latest-amd64
# create, annotate and push manifests for latest-arm32v5
docker manifest create storjlabs/storagenode-base:latest-arm32v5 storjlabs/storagenode-base:${GIT_TAG}${CUSTOMTAG}-arm32v5
docker manifest annotate storjlabs/storagenode-base:latest-arm32v5 storjlabs/storagenode-base:${GIT_TAG}${CUSTOMTAG}-arm32v5 --os linux --arch arm --variant v6
docker manifest annotate storjlabs/storagenode-base:latest-arm32v5 storjlabs/storagenode-base:${GIT_TAG}${CUSTOMTAG}-arm32v5 --os linux --arch arm --variant v5
docker manifest push --purge storjlabs/storagenode-base:latest-arm32v5
# create, annotate and push manifests for latest-arm64v8
docker manifest create storjlabs/storagenode-base:latest-arm64v8 storjlabs/storagenode-base:${GIT_TAG}${CUSTOMTAG}-arm64v8
@ -262,7 +262,7 @@ push-storagenode-base-image: ## Push the storagenode base image to dockerhub
storjlabs/storagenode-base:${GIT_TAG}${CUSTOMTAG}-arm32v5 \
storjlabs/storagenode-base:${GIT_TAG}${CUSTOMTAG}-arm64v8 \
&& docker manifest annotate storjlabs/storagenode-base:$$t storjlabs/storagenode-base:${GIT_TAG}${CUSTOMTAG}-amd64 --os linux --arch amd64 \
&& docker manifest annotate storjlabs/storagenode-base:$$t storjlabs/storagenode-base:${GIT_TAG}${CUSTOMTAG}-arm32v5 --os linux --arch arm --variant v6 \
&& docker manifest annotate storjlabs/storagenode-base:$$t storjlabs/storagenode-base:${GIT_TAG}${CUSTOMTAG}-arm32v5 --os linux --arch arm --variant v5 \
&& docker manifest annotate storjlabs/storagenode-base:$$t storjlabs/storagenode-base:${GIT_TAG}${CUSTOMTAG}-arm64v8 --os linux --arch arm64 --variant v8 \
&& docker manifest push --purge storjlabs/storagenode-base:$$t \
; done
@ -271,8 +271,8 @@ push-storagenode-base-image: ## Push the storagenode base image to dockerhub
versioncontrol-image: versioncontrol_linux_arm versioncontrol_linux_arm64 versioncontrol_linux_amd64 ## Build versioncontrol Docker image
${DOCKER_BUILD} --pull=true -t storjlabs/versioncontrol:${TAG}${CUSTOMTAG}-amd64 \
-f cmd/versioncontrol/Dockerfile .
${DOCKER_BUILD} --pull=true -t storjlabs/versioncontrol:${TAG}${CUSTOMTAG}-arm32v6 \
--build-arg=GOARCH=arm --build-arg=DOCKER_ARCH=arm32v6 \
${DOCKER_BUILD} --pull=true -t storjlabs/versioncontrol:${TAG}${CUSTOMTAG}-arm32v5 \
--build-arg=GOARCH=arm --build-arg=DOCKER_ARCH=arm32v5 \
-f cmd/versioncontrol/Dockerfile .
${DOCKER_BUILD} --pull=true -t storjlabs/versioncontrol:${TAG}${CUSTOMTAG}-arm64v8 \
--build-arg=GOARCH=arm64 --build-arg=DOCKER_ARCH=arm64v8 \
@ -371,19 +371,19 @@ sign-windows-installer:
##@ Deploy
.PHONY: push-images
push-images: push-storagenode-images ## Push Docker images to Docker Hub (jenkins)
push-images: ## Push Docker images to Docker Hub (jenkins)
# images have to be pushed before a manifest can be created
for c in multinode satellite uplink versioncontrol ; do \
for c in multinode satellite uplink storagenode versioncontrol ; do \
docker push storjlabs/$$c:${TAG}${CUSTOMTAG}-amd64 \
&& docker push storjlabs/$$c:${TAG}${CUSTOMTAG}-arm32v6 \
&& docker push storjlabs/$$c:${TAG}${CUSTOMTAG}-arm32v5 \
&& docker push storjlabs/$$c:${TAG}${CUSTOMTAG}-arm64v8 \
&& for t in ${TAG}${CUSTOMTAG} ${LATEST_TAG}; do \
docker manifest create storjlabs/$$c:$$t \
storjlabs/$$c:${TAG}${CUSTOMTAG}-amd64 \
storjlabs/$$c:${TAG}${CUSTOMTAG}-arm32v6 \
storjlabs/$$c:${TAG}${CUSTOMTAG}-arm32v5 \
storjlabs/$$c:${TAG}${CUSTOMTAG}-arm64v8 \
&& docker manifest annotate storjlabs/$$c:$$t storjlabs/$$c:${TAG}${CUSTOMTAG}-amd64 --os linux --arch amd64 \
&& docker manifest annotate storjlabs/$$c:$$t storjlabs/$$c:${TAG}${CUSTOMTAG}-arm32v6 --os linux --arch arm --variant v6 \
&& docker manifest annotate storjlabs/$$c:$$t storjlabs/$$c:${TAG}${CUSTOMTAG}-arm32v5 --os linux --arch arm --variant v5 \
&& docker manifest annotate storjlabs/$$c:$$t storjlabs/$$c:${TAG}${CUSTOMTAG}-arm64v8 --os linux --arch arm64 --variant v8 \
&& docker manifest push --purge storjlabs/$$c:$$t \
; done \

View File

@ -1,10 +1,11 @@
ARG DOCKER_ARCH
# Fetch ca-certificates file for arch independent builds below
FROM alpine as ca-cert
RUN apk -U add ca-certificates
FROM debian:buster-slim as ca-cert
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates
RUN update-ca-certificates
FROM ${DOCKER_ARCH:-amd64}/alpine
FROM ${DOCKER_ARCH:-amd64}/debian:buster-slim
ARG TAG
ARG GOARCH
ENV GOARCH ${GOARCH}

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
set -euo pipefail
if [[ ! -f "/app/config/config.yaml" ]]; then

View File

@ -8,10 +8,11 @@ RUN npm install
RUN npm run build
# Fetch ca-certificates file for arch independent builds below
FROM alpine as ca-cert
RUN apk -U add ca-certificates
FROM debian:buster-slim as ca-cert
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates
RUN update-ca-certificates
FROM ${DOCKER_ARCH:-amd64}/alpine
FROM ${DOCKER_ARCH:-amd64}/debian:buster-slim
ARG TAG
ARG GOARCH
ENV GOARCH ${GOARCH}

View File

@ -1,13 +1,13 @@
#!/bin/sh
#!/bin/bash
set -euo pipefail
SETUP_PARAMS=""
if [[ -n "${IDENTITY_ADDR:-}" ]]; then
if [ -n "${IDENTITY_ADDR:-}" ]; then
export STORJ_SERVER_ADDRESS="${IDENTITY_ADDR}"
fi
if [[ ! -f "${CONF_PATH}/config.yaml" ]]; then
if [ ! -f "${CONF_PATH}/config.yaml" ]; then
./satellite setup $SETUP_PARAMS
fi

View File

@ -1,5 +1,5 @@
ARG DOCKER_ARCH
FROM ${DOCKER_ARCH:-amd64}/alpine
FROM ${DOCKER_ARCH:-amd64}/debian:buster-slim
ARG TAG
ARG GOARCH
ENV GOARCH ${GOARCH}

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
if [ ! -f $HOME/.local/share/storj/versioncontrol/config.yaml ]; then
/app/versioncontrol setup