-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Dockerfile.base
52 lines (43 loc) · 1.9 KB
/
Dockerfile.base
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
ARG COSIGN_VERSION
ARG COSIGN_SHA256
ARG TOOLCHAINS_VERSION
FROM ghcr.io/sigstore/cosign/cosign:v$COSIGN_VERSION@sha256:$COSIGN_SHA256 as cosign
FROM ghcr.io/goreleaser/goreleaser-cross-toolchains:$TOOLCHAINS_VERSION
LABEL maintainer="Artur Troian <troian dot ap at gmail dot com>"
LABEL "org.opencontainers.image.source"="https://github.com/goreleaser/goreleaser-cross-base"
ARG DEBIAN_FRONTEND=noninteractive
ARG TINI_VERSION
ARG GO_VERSION
ARG TARGETARCH
COPY entrypoint.sh /
# Install deps
RUN \
echo "Starting image build for Debian" \
&& sed -ri "s/(httpredir|deb).debian.org/${APT_MIRROR:-deb.debian.org}/g" /etc/apt/sources.list \
&& sed -ri "s/(security).debian.org/${APT_MIRROR:-security.debian.org}/g" /etc/apt/sources.list \
&& apt-get update \
&& apt-get install --no-install-recommends -y -q \
software-properties-common \
curl \
gnupg2 \
openssh-client \
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb [arch=$TARGETARCH] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list \
&& apt-get update \
&& apt-get install --no-install-recommends -y -q \
docker-ce \
docker-ce-cli \
tini \
&& apt -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& wget https://go.dev/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz \
&& rm -rf /usr/local/go && tar -C /usr/local -xzf go${GO_VERSION}.linux-${TARGETARCH}.tar.gz \
&& rm go${GO_VERSION}.linux-${TARGETARCH}.tar.gz \
&& chmod +x /entrypoint.sh
COPY --from=cosign /ko-app/cosign /usr/local/bin/cosign
COPY --from=docker/buildx-bin:latest /buildx /usr/libexec/docker/cli-plugins/docker-buildx
ENV OSX_CROSS_PATH=/usr/local/osxcross
ENV PATH=$PATH:/usr/local/go/bin
ENV PATH=$PATH:"$OSX_CROSS_PATH/bin"
ENTRYPOINT ["/usr/bin/tini", "--", "/entrypoint.sh"]