-
Notifications
You must be signed in to change notification settings - Fork 335
/
Dockerfile.ci
75 lines (68 loc) · 2.61 KB
/
Dockerfile.ci
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
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM debian:bookworm
# set env vars
ARG DEBIAN_FRONTEND=noninteractive
ENV OPEN_MATCH_CI_MODE=1
ENV KUBECONFIG=$HOME/.kube/config
ENV GOPATH=/go
ENV PATH=$GOPATH/bin:/usr/local/go/bin:$PATH
RUN apt-get update -y \
&& apt-get install -y -qq --no-install-recommends \
apt-utils \
git \
make \
python3 \
virtualenv \
curl \
sudo \
unzip \
apt-transport-https \
ca-certificates \
curl \
software-properties-common \
gnupg2 \
libc6 \
build-essential
RUN mkdir -p /usr/share/keyrings/
# Docker
RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/debian bookworm stable" | tee -a /etc/apt/sources.list.d/docker.list \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker.gpg \
&& apt-get update -y \
&& apt-get install -y -qq \
docker-ce \
docker-ce-cli \
containerd.io
# Cloud SDK
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list \
&& curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - \
&& apt-get update -y \
&& apt-get install -y -qq \
google-cloud-cli \
google-cloud-sdk-gke-gcloud-auth-plugin
# Install Golang
RUN mkdir -p /toolchain/golang
WORKDIR /toolchain/golang
RUN rm -rf /usr/local/go/
# When updating Go version, update Dockerfile.ci, Dockerfile.base-build, and go.mod
# reference: https://github.com/docker-library/golang/blob/master/1.20/bookworm/Dockerfile
RUN curl -L https://golang.org/dl/go1.21.5.linux-amd64.tar.gz | tar -C /usr/local -xz
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" \
&& chmod -R 777 "$GOPATH"
# Prepare toolchain, workspace, homedir
RUN mkdir -p \
/toolchain \
/workspace \
$HOME/.kube/
WORKDIR /workspace