Fix broken docker builds

This commit is contained in:
Michele Degges 2022-01-14 13:05:16 -08:00
parent 0d0b55bd1b
commit 8d0b03b54d
4 changed files with 30 additions and 4 deletions

View File

@ -4,7 +4,8 @@ on:
push: push:
# Sequence of patterns matched against refs/heads # Sequence of patterns matched against refs/heads
branches: [ branches: [
"main" "main",
"fix-broken-dockerfile", // just needed for testing, remove before merge
] ]
env: env:
@ -241,6 +242,10 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Docker Build (Action) - name: Docker Build (Action)
uses: hashicorp/actions-docker-build@v1 uses: hashicorp/actions-docker-build@v1
with: with:

View File

@ -14,7 +14,8 @@ project "consul" {
"release/1.8.x", "release/1.8.x",
"release/1.9.x", "release/1.9.x",
"release/1.10.x", "release/1.10.x",
"release/1.11.x" "release/1.11.x",
"fix-broken-dockerfile", // just needed for testing, remove before merge
] ]
} }
} }

View File

@ -1,5 +1,5 @@
# This Dockerfile creates a production release image for the project using crt release flow. # This Dockerfile creates a production release image for the project using crt release flow.
FROM alpine:3.13 as default FROM alpine:3.15.0 as default
ARG VERSION ARG VERSION
ARG BIN_NAME ARG BIN_NAME
@ -24,7 +24,23 @@ LABEL org.opencontainers.image.authors="Consul Team <consul@hashicorp.com>" \
org.opencontainers.image.title="consul" \ org.opencontainers.image.title="consul" \
org.opencontainers.image.description="Consul is a datacenter runtime that provides service discovery, configuration, and orchestration." org.opencontainers.image.description="Consul is a datacenter runtime that provides service discovery, configuration, and orchestration."
RUN apk add --no-cache dumb-init # Set up certificates and base tools.
# libc6-compat is needed to symlink the shared libraries for ARM builds
RUN apk update
RUN apk add -v --no-cache \
dumb-init \
libc6-compat \
iptables \
tzdata \
curl \
ca-certificates \
gnupg \
iputils \
libcap \
openssl \
su-exec \
jq
# Create a consul user and group first so the IDs get set the same way, even as # Create a consul user and group first so the IDs get set the same way, even as
# the rest of this may change over time. # the rest of this may change over time.
RUN addgroup $BIN_NAME && \ RUN addgroup $BIN_NAME && \
@ -36,6 +52,10 @@ RUN mkdir -p /consul/data && \
mkdir -p /consul/config && \ mkdir -p /consul/config && \
chown -R consul:consul /consul chown -R consul:consul /consul
# Set up nsswitch.conf for Go's "netgo" implementation which is used by Consul,
# otherwise DNS supercedes the container's hosts file, which we don't want.
RUN test -e /etc/nsswitch.conf || echo 'hosts: files dns' > /etc/nsswitch.conf
# Expose the consul data directory as a volume since there's mutable state in there. # Expose the consul data directory as a volume since there's mutable state in there.
VOLUME /consul/data VOLUME /consul/data