forked from troian/golang-cross
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.base
51 lines (45 loc) · 1.84 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
# golang parameters
ARG GO_VERSION
FROM golang:${GO_VERSION}-buster
ARG DEBIAN_FRONTEND=noninteractive
ARG GORELEASER_VERSION
ARG GORELEASER_SHA
ARG APT_MIRROR
ARG TINI_VERSION
LABEL maintainer="Oslo Kommune - Kjøremiljø"
COPY entrypoint.sh /
# Install deps
RUN \
set -x \
# Run tini as PID 1 and avoid signal handling issues
&& curl --fail -sSL -o /tini https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-amd64 \
&& chmod +x /tini \
&& echo "Starting image build for Debian Stretch" \
&& 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 -fsSL https://download.docker.com/linux/ubuntu/gpg | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" \
&& apt-get update \
&& apt-get install --no-install-recommends -y -q \
docker-ce \
docker-ce-cli \
make \
git-core \
wget \
xz-utils \
cmake \
openssl \
&& apt -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& GORELEASER_DOWNLOAD_FILE=goreleaser_Linux_x86_64.tar.gz \
&& GORELEASER_DOWNLOAD_URL=https://github.com/goreleaser/goreleaser/releases/download/v${GORELEASER_VERSION}/${GORELEASER_DOWNLOAD_FILE} \
&& wget ${GORELEASER_DOWNLOAD_URL} \
&& echo "$GORELEASER_SHA $GORELEASER_DOWNLOAD_FILE" | sha256sum -c - || exit 1 \
&& tar -xzf $GORELEASER_DOWNLOAD_FILE -C /usr/bin/ goreleaser \
&& rm $GORELEASER_DOWNLOAD_FILE \
&& chmod +x /entrypoint.sh
ENTRYPOINT ["/tini", "--", "/entrypoint.sh"]