forked from rancher/kubernetes-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dapper
More file actions
74 lines (68 loc) · 3.05 KB
/
Copy pathDockerfile.dapper
File metadata and controls
74 lines (68 loc) · 3.05 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
FROM ubuntu:26.04
ARG DAPPER_HOST_ARCH=amd64
ARG DOCKER_VERSION=29.5.3
ARG GO_VERSION=1.26.5
ARG GO_SHA256_amd64=5c2c3b16caefa1d968a94c1daca04a7ca301a496d9b086e17ad77bb81393f053
ARG GO_SHA256_arm64=fe4789e92b1f33358680864bbe8704289e7bb5fc207d80623c308935bd696d49
ARG DOCKER_SHA256_amd64=34eea64e9c3435f5af1b760827a56a561cd67fc2d6e9cd1813b8bb1e3ff7930b
ARG DOCKER_SHA256_arm64=02eea44490f1f39ce340fe0bc74124002d957bacaa574d66345fbb353381362d
ARG UBUNTU_MIRROR=http://archive.ubuntu.com/ubuntu
ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH}
ENV GOPATH=/go PATH=/go/bin:/usr/local/go/bin:${PATH} SHELL=/bin/bash
ENV GO111MODULE=off
ENV DEBIAN_FRONTEND=noninteractive
ENV DAPPER_SOURCE=/go/src/github.com/PastureStack/kubernetes-agent
ENV DAPPER_OUTPUT="bin dist"
ENV DAPPER_DOCKER_SOCKET=true
ENV DAPPER_ENV="TAG REPO IMAGE_NAME VERSION_OVERRIDE DOCKER_BUILD_NETWORK UBUNTU_MIRROR"
ENV GO15VENDOREXPERIMENT=1
ENV TRASH_CACHE=${DAPPER_SOURCE}/.trash-cache
ENV HOME=${DAPPER_SOURCE}
RUN set -eux; \
find /etc/apt -type f \( -name '*.list' -o -name '*.sources' \) -exec sed -i \
-e "s|http://security.ubuntu.com/ubuntu|${UBUNTU_MIRROR}|g" \
-e "s|http://archive.ubuntu.com/ubuntu|${UBUNTU_MIRROR}|g" {} +; \
printf 'Acquire::Retries "5";\nAcquire::http::Timeout "30";\nAcquire::https::Timeout "30";\nAcquire::http::Pipeline-Depth "0";\n' > /etc/apt/apt.conf.d/80pasturestack-retries; \
apt-get update; \
apt-get install -y --no-install-recommends \
bash \
ca-certificates \
curl \
file \
gcc \
git \
iproute2 \
iptables \
kmod \
libc6-dev \
make \
tar \
xz-utils; \
rm -rf /var/lib/apt/lists/*; \
rm -f /bin/sh; \
ln -s /bin/bash /bin/sh
RUN set -eux; \
case "${DAPPER_HOST_ARCH}" in \
amd64) go_arch=amd64; docker_arch=x86_64; go_sha="${GO_SHA256_amd64}"; docker_sha="${DOCKER_SHA256_amd64}" ;; \
arm64) go_arch=arm64; docker_arch=aarch64; go_sha="${GO_SHA256_arm64}"; docker_sha="${DOCKER_SHA256_arm64}" ;; \
*) echo "unsupported DAPPER_HOST_ARCH=${DAPPER_HOST_ARCH}" >&2; exit 1 ;; \
esac; \
curl -fsSL --retry 5 --retry-all-errors --retry-delay 2 --connect-timeout 10 --max-time 300 \
-o /tmp/go.tgz "https://go.dev/dl/go${GO_VERSION}.linux-${go_arch}.tar.gz"; \
echo "${go_sha} /tmp/go.tgz" | sha256sum -c -; \
tar -C /usr/local -xzf /tmp/go.tgz; \
rm -f /tmp/go.tgz; \
docker_tgz=/tmp/docker.tgz; \
curl -fsSL --retry 5 --retry-all-errors --retry-delay 2 --connect-timeout 10 --max-time 300 \
-o "$docker_tgz" "https://download.docker.com/linux/static/stable/${docker_arch}/docker-${DOCKER_VERSION}.tgz"; \
echo "${docker_sha} ${docker_tgz}" | sha256sum -c -; \
tar xzf "$docker_tgz" -C /usr/bin --strip-components=1 docker/docker; \
rm -f "$docker_tgz"; \
chmod +x /usr/bin/docker; \
mkdir -p /go/bin /go/src; \
go version; \
docker --version
RUN git config --system --add safe.directory '*'
WORKDIR ${DAPPER_SOURCE}
ENTRYPOINT ["./scripts/entry"]
CMD ["ci"]