forked from CircleCI-Public/cimg-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.template
32 lines (25 loc) · 1.39 KB
/
Dockerfile.template
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
# vim:set ft=dockerfile:
# Do not edit individual Dockerfiles manually. Instead, please make changes to the Dockerfile.template, which will be used by the build script to generate Dockerfiles.
# By policy, the base image tag should be a quarterly tag unless there's a
# specific reason to use a different one. This means January, April, July, or
# October.
FROM cimg/%%PARENT%%:2023.07
LABEL maintainer="Community & Partner Engineering Team <[email protected]>"
ENV GO_VER="%%VERSION_FULL%%"
# Install packages needed for CGO
RUN sudo apt-get update && sudo apt-get install -y --no-install-recommends \
g++ \
libc6-dev && \
sudo rm -rf /var/lib/apt/lists/* && \
[[ $(uname -m) == "x86_64" ]] && ARCH="amd64" || ARCH="arm64" && \
curl -sSL "https://go.dev/dl/go${GO_VER}.linux-${ARCH}.tar.gz" | sudo tar -xz -C /usr/local/ && \
mkdir -p /home/circleci/go/bin
# Install related tools
ENV GOTESTSUM_V=1.10.1
ENV GOCI_LINT_V=1.53.3
RUN [[ $(uname -m) == "x86_64" ]] && ARCH="amd64" || ARCH="arm64" && \
curl -sSL "https://github.com/gotestyourself/gotestsum/releases/download/v${GOTESTSUM_V}/gotestsum_${GOTESTSUM_V}_linux_${ARCH}.tar.gz" | \
sudo tar -xz -C /usr/local/bin gotestsum && \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/local/bin v${GOCI_LINT_V}
ENV GOPATH /home/circleci/go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH