|
1 | 1 | # syntax=docker/dockerfile:1.4 |
2 | | -ARG VARIANT="1-1.22-bookworm" |
| 2 | +ARG VARIANT="1-1.23-bookworm" |
3 | 3 | FROM mcr.microsoft.com/devcontainers/go:${VARIANT} |
4 | 4 |
|
| 5 | +# Use bash globally for pipefail |
| 6 | +SHELL ["/bin/bash", "-o", "pipefail", "-c"] |
| 7 | + |
5 | 8 | ARG DEBIAN_FRONTEND=noninteractive |
6 | 9 |
|
7 | | -# Keep the base image packages patched and install common utilities needed for |
8 | | -# development and release tooling. |
9 | | -RUN apt-get update \ |
10 | | - && apt-get upgrade -y \ |
11 | | - && apt-get install -y --no-install-recommends \ |
12 | | - ca-certificates \ |
13 | | - curl \ |
14 | | - jq \ |
15 | | - && apt-get autoremove -y \ |
16 | | - && apt-get clean \ |
17 | | - && rm -rf /var/lib/apt/lists/* |
| 10 | +RUN set -eux; \ |
| 11 | + apt-get update; \ |
| 12 | + apt-get -y upgrade; \ |
| 13 | + apt-get install -y --no-install-recommends \ |
| 14 | + ca-certificates curl fuse-overlayfs iptables jq podman slirp4netns uidmap; \ |
| 15 | + rm -rf /var/lib/apt/lists/* |
| 16 | + |
| 17 | +# Podman shim |
| 18 | +RUN <<'BASH' |
| 19 | +set -euo pipefail |
| 20 | +echo "vscode ALL=(ALL) NOPASSWD: /usr/bin/install, /usr/bin/podman" >/etc/sudoers.d/010-vscode-podman |
| 21 | +chmod 0440 /etc/sudoers.d/010-vscode-podman |
| 22 | +install -d -m 0755 /usr/local/bin |
| 23 | +BASH |
18 | 24 |
|
19 | | -# Install etcd from the latest stable upstream release so local tests can rely |
20 | | -# on an etcd binary that matches production expectations. |
| 25 | +# Install etcd (arch-aware, ohne Hash) |
21 | 26 | ARG ETCD_VERSION="3.6.4" |
22 | | -ARG ETCD_SHA256="4d5f3101daa534e45ccaf3eec8d21c19b7222db377bcfd5e5a9144155238c105" |
23 | | -RUN curl -fsSL https://github.com/etcd-io/etcd/releases/download/v${ETCD_VERSION}/etcd-v${ETCD_VERSION}-linux-amd64.tar.gz -o /tmp/etcd.tgz \ |
24 | | - && echo "${ETCD_SHA256} /tmp/etcd.tgz" | sha256sum -c - \ |
25 | | - && tar -xzf /tmp/etcd.tgz -C /tmp \ |
26 | | - && install -m 0755 /tmp/etcd-v${ETCD_VERSION}-linux-amd64/etcd /usr/local/bin/etcd \ |
27 | | - && install -m 0755 /tmp/etcd-v${ETCD_VERSION}-linux-amd64/etcdctl /usr/local/bin/etcdctl \ |
28 | | - && install -m 0755 /tmp/etcd-v${ETCD_VERSION}-linux-amd64/etcdutl /usr/local/bin/etcdutl \ |
29 | | - && rm -rf /tmp/etcd.tgz /tmp/etcd-v${ETCD_VERSION}-linux-amd64 |
| 27 | +RUN set -eux; \ |
| 28 | + arch="$(dpkg --print-architecture)"; \ |
| 29 | + curl -fsSL -o /tmp/etcd.tgz "https://github.com/etcd-io/etcd/releases/download/v${ETCD_VERSION}/etcd-v${ETCD_VERSION}-linux-${arch}.tar.gz"; \ |
| 30 | + tar -xzf /tmp/etcd.tgz -C /tmp; \ |
| 31 | + install -m 0755 /tmp/etcd-v${ETCD_VERSION}-linux-${arch}/etcd /usr/local/bin/etcd; \ |
| 32 | + install -m 0755 /tmp/etcd-v${ETCD_VERSION}-linux-${arch}/etcdctl /usr/local/bin/etcdctl; \ |
| 33 | + install -m 0755 /tmp/etcd-v${ETCD_VERSION}-linux-${arch}/etcdutl /usr/local/bin/etcdutl; \ |
| 34 | + rm -rf /tmp/etcd.tgz /tmp/etcd-v${ETCD_VERSION}-linux-${arch} |
30 | 35 |
|
31 | | -# Install nfpm so packaging workflows inside the container can build .deb/.rpm |
32 | | -# artefacts without extra manual setup. Assets are fetched from the official |
33 | | -# release and verified using the published SHA256 checksum. |
| 36 | +# Install nfpm (arch-aware, ohne Hash) |
34 | 37 | ARG NFPM_VERSION="2.43.1" |
35 | | -ARG NFPM_SHA256="2bc2c0b4a13ddbf8ffb0e1df36c43208db6d65a38832c9fe0de097f985653267" |
36 | | -RUN curl -fsSL https://github.com/goreleaser/nfpm/releases/download/v${NFPM_VERSION}/nfpm_${NFPM_VERSION}_Linux_x86_64.tar.gz -o /tmp/nfpm.tgz \ |
37 | | - && echo "${NFPM_SHA256} /tmp/nfpm.tgz" | sha256sum -c - \ |
38 | | - && tar -xzf /tmp/nfpm.tgz -C /tmp \ |
39 | | - && install -m 0755 /tmp/nfpm /usr/local/bin/nfpm \ |
40 | | - && rm -f /tmp/nfpm /tmp/nfpm.tgz /tmp/LICENSE.md /tmp/README.md \ |
41 | | - && rm -rf /tmp/completions /tmp/manpages |
| 38 | +RUN set -eux; \ |
| 39 | + arch="$(dpkg --print-architecture)"; \ |
| 40 | + case "$arch" in \ |
| 41 | + amd64) nfpm_arch="x86_64" ;; \ |
| 42 | + arm64) nfpm_arch="arm64" ;; \ |
| 43 | + *) echo "Unsupported arch: $arch" >&2; exit 1 ;; \ |
| 44 | + esac; \ |
| 45 | + curl -fsSL -o /tmp/nfpm.tgz "https://github.com/goreleaser/nfpm/releases/download/v${NFPM_VERSION}/nfpm_${NFPM_VERSION}_Linux_${nfpm_arch}.tar.gz"; \ |
| 46 | + tar -xzf /tmp/nfpm.tgz -C /tmp; \ |
| 47 | + install -m 0755 /tmp/nfpm /usr/local/bin/nfpm; \ |
| 48 | + rm -f /tmp/nfpm /tmp/nfpm.tgz /tmp/LICENSE.md /tmp/README.md; \ |
| 49 | + rm -rf /tmp/completions /tmp/manpages |
42 | 50 |
|
43 | | -# Validate the installation early so container builds fail fast if upstream |
44 | | -# assets change or become unavailable. |
45 | | -RUN etcd --version && etcdctl version && nfpm --version |
| 51 | +# Smoke test |
| 52 | +RUN set -eux; etcd --version; etcdctl version; nfpm --version |
0 commit comments