forked from rancher/lb-controller
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dapper
More file actions
80 lines (71 loc) · 3.1 KB
/
Copy pathDockerfile.dapper
File metadata and controls
80 lines (71 loc) · 3.1 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
75
76
77
78
79
80
FROM ubuntu:26.04
ARG DAPPER_HOST_ARCH=amd64
ARG GO_VERSION=1.26.5
ARG DOCKER_VERSION=29.5.3
ARG GO_LINUX_AMD64_SHA256=5c2c3b16caefa1d968a94c1daca04a7ca301a496d9b086e17ad77bb81393f053
ARG GO_LINUX_ARM64_SHA256=fe4789e92b1f33358680864bbe8704289e7bb5fc207d80623c308935bd696d49
ARG UBUNTU_MIRROR=http://archive.ubuntu.com/ubuntu
ENV DEBIAN_FRONTEND=noninteractive
ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH}
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/80rc16-retries; \
apt-get update && \
apt-get install -y --no-install-recommends \
bash \
ca-certificates \
curl \
file \
gcc \
git \
libc6-dev \
make \
tar \
xz-utils && \
rm -rf /var/lib/apt/lists/* && \
rm -f /usr/bin/pebble && \
rm -f /bin/sh && ln -s /bin/bash /bin/sh
ENV GOPATH=/go \
PATH=/go/bin:/usr/local/go/bin:${PATH} \
SHELL=/bin/bash \
GO111MODULE=off \
GO15VENDOREXPERIMENT=1 \
GOCACHE=/tmp/go-build-cache \
GOTELEMETRY=off \
XDG_CONFIG_HOME=/tmp/go-config \
GIT_CONFIG_GLOBAL=/tmp/gitconfig
RUN case "${DAPPER_HOST_ARCH}" in \
amd64) go_arch=amd64; go_sha="${GO_LINUX_AMD64_SHA256}" ;; \
arm64) go_arch=arm64; go_sha="${GO_LINUX_ARM64_SHA256}" ;; \
*) 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 -xzf /tmp/go.tgz -C /usr/local && \
rm -f /tmp/go.tgz && \
go version
RUN case "${DAPPER_HOST_ARCH}" in \
amd64) docker_arch=x86_64 ;; \
arm64) docker_arch=aarch64 ;; \
*) echo "unsupported DAPPER_HOST_ARCH=${DAPPER_HOST_ARCH}" >&2; exit 1 ;; \
esac && \
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" && \
tar xzf "$docker_tgz" -C /usr/bin --strip-components=1 docker/docker && \
rm -f "$docker_tgz" && \
chmod +x /usr/bin/docker && \
docker --version
ENV DAPPER_SOURCE=/go/src/github.com/rancher/lb-controller/
ENV DAPPER_OUTPUT="./bin ./dist"
ENV DAPPER_DOCKER_SOCKET=true
ENV DAPPER_ENV="TAG REPO IMAGE_NAMESPACE IMAGE_PREFIX VERSION_OVERRIDE DOCKER_BUILD_NETWORK UBUNTU_MIRROR"
ENV HOME=${DAPPER_SOURCE}
WORKDIR ${DAPPER_SOURCE}
RUN git config --system --add safe.directory ${DAPPER_SOURCE} && \
git config --system --add safe.directory /go/src/github.com/rancher/lb-controller
ENTRYPOINT ["./scripts/entry"]
CMD ["ci"]