-
Notifications
You must be signed in to change notification settings - Fork 18
/
Dockerfile.builder
48 lines (41 loc) · 1.82 KB
/
Dockerfile.builder
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
# Ubuntu 22.04 is our base image for building
FROM ubuntu:22.04
# set up timezone
ENV TZ=GMT
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# update software
RUN apt -y --fix-missing update
RUN apt -y full-upgrade
RUN apt -y autoremove
RUN apt -y clean
# install docker
RUN apt -y update
RUN apt -y install curl gnupg lsb-release software-properties-common git build-essential wget awscli sudo
# golang variables
ARG golang_version="1.21.4"
ARG golang_hostarch="linux-amd64"
ARG golang_filename="go${golang_version}.${golang_hostarch}.tar.gz"
ARG golang_url="https://golang.org/dl/${golang_filename}"
ARG golang_sha256="73cac0215254d0c7d1241fa40837851f3b9a8a742d0b54714cbdfb3feaf8f0af"
# install golang
RUN wget -nv ${golang_url}
RUN echo "${golang_sha256} ${golang_filename}" > "${golang_filename}.sha256"
RUN sha256sum -c ${golang_filename}.sha256
RUN tar -C /usr/local -xzf ${golang_filename}
RUN rm -rf ${golang_filename}*
ENV PATH="${PATH}:/usr/local/go/bin"
ENV GOROOT="/usr/local/go"
# install go-junit-report
RUN go install -v github.com/RyanLucchese/go-junit-report@latest
ENV PATH="${PATH}:/root/go/bin"
RUN mkdir -p "/go/src/github.com/energicryptocurrency/go-energi"
WORKDIR "/go/src/github.com/energicryptocurrency/go-energi"
ADD Makefile.release Makefile.release
# this git config supports bind mounting a local repo into a root container
RUN git config --global --add safe.directory /go/src/github.com/energicryptocurrency/go-energi
RUN git config --global --add safe.directory /go/src/github.com/energicryptocurrency/go-energi/energi/governance
RUN git config --global --add safe.directory /go/src/github.com/energicryptocurrency/go-energi/tests/testdata
RUN make -f Makefile.release release-tools
ENV GOPATH="/go"
ENV GOBIN="/go/src/github.com/energicryptocurrency/go-energi/build/bin"
ENV GOFLAGS="-v"