-
Notifications
You must be signed in to change notification settings - Fork 111
/
Dockerfile
38 lines (31 loc) · 1.04 KB
/
Dockerfile
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
FROM ubuntu:22.04
RUN apt-get update && apt-get install -y make git-core build-essential curl python3 wget unzip
# Install Go
RUN \
mkdir -p /goroot && \
curl https://storage.googleapis.com/golang/go1.14.9.linux-amd64.tar.gz | tar xvzf - -C /goroot --strip-components=1
# Install Make, we emulate Make 4.2.1 instead of the default 4.3 currently
RUN \
mkdir -p /make/tmp && \
cd /make/tmp && \
wget http://mirrors.kernel.org/ubuntu/pool/main/m/make-dfsg/make_4.2.1-1.2_amd64.deb && \
ar xv make_4.2.1-1.2_amd64.deb && \
tar xf data.tar.xz && \
mv usr/bin/make ../ && \
cd .. && \
rm -rf tmp/
# Install ninja, we need a newer version than is in apt
RUN \
mkdir -p /ninja && \
cd /ninja && \
wget https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-linux.zip && \
unzip ninja-linux.zip && \
rm ninja-linux.zip
# Set environment variables for Go and Make.
ENV GOROOT /goroot
ENV GOPATH /gopath
ENV PATH $GOROOT/bin:$GOPATH/bin:/make:/ninja:$PATH
# Copy project code.
COPY . /src
WORKDIR /src
CMD make test -j8