Browse Source

Fix broken docker builds

pull/12097/head
Michele Degges 3 years ago
parent
commit
3f894604bb
  1. 7
      .github/workflows/build.yml
  2. 3
      .release/ci.hcl
  3. 0
      .release/linux/package/etc/consul.d/consul.env
  4. 24
      Dockerfile

7
.github/workflows/build.yml

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

3
.release/ci.hcl

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

0
.release/linux/package/etc/consul.d/consul.env

24
Dockerfile

@ -1,5 +1,5 @@
# 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 BIN_NAME
@ -24,7 +24,23 @@ LABEL org.opencontainers.image.authors="Consul Team <consul@hashicorp.com>" \
org.opencontainers.image.title="consul" \
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
# the rest of this may change over time.
RUN addgroup $BIN_NAME && \
@ -36,6 +52,10 @@ RUN mkdir -p /consul/data && \
mkdir -p /consul/config && \
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.
VOLUME /consul/data

Loading…
Cancel
Save