forked from testground/testground
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.sidecar
43 lines (27 loc) · 1008 Bytes
/
Dockerfile.sidecar
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
#:::
#::: BUILD CONTAINER
#:::
# GO_VERSION is the golang version this image will be built against.
ARG GO_VERSION=1.14
# Dynamically select the golang version.
FROM golang:${GO_VERSION}-buster
COPY /go.mod /go.mod
# Download deps.
RUN cd / && GOPROXY=https://goproxy.cn go mod download -x
# Now copy the rest of the source and run the build.
COPY . /
# Testground version
ARG TG_VERSION
RUN cd / && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-X github.com/testground/testground/pkg/version.GitCommit=${TG_VERSION}" -o testground
#:::
#::: RUNTIME CONTAINER
#:::
FROM debian:buster
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
RUN sed -i 's|security.debian.org/debian-security|mirrors.ustc.edu.cn/debian-security|g' /etc/apt/sources.list
RUN apt update && apt install -y iptables
RUN mkdir -p /usr/local/bin
COPY --from=0 /testground /usr/local/bin/testground
ENV PATH="/usr/local/bin:${PATH}"
EXPOSE 6060
ENTRYPOINT [ "/usr/local/bin/testground" ]