forked from openshift-kni/numaresources-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.tools
46 lines (39 loc) · 1.48 KB
/
Dockerfile.tools
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
FROM registry.access.redhat.com/ubi9/ubi
ENV HOME=/home/ci
ENV GOROOT=/usr/local/go
ENV GOVERSION=1.21.3
ENV GOPATH=/go
ENV GOBIN=${GOPATH}/bin
ENV PATH=${PATH}:${GOROOT}/bin:${GOBIN}
ARG GO_PACKAGE_PATH=github.com/openshift-kni/numaresources-operator
# rpms required for building and running test suites
RUN yum --setopt=install_weak_deps=False -y install \
gcc \
git \
make \
gettext \
which \
findutils \
&& yum clean all
RUN mkdir -p $HOME && \
# install go
curl -JL https://dl.google.com/go/go${GOVERSION}.linux-amd64.tar.gz -o go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz && \
# get required golang tools and OC client
go install golang.org/x/lint/golint@latest && \
go install github.com/mattn/goveralls@latest && \
go clean -cache -modcache && \
rm -rf ${GOPATH}/src/* && \
rm -rf ${GOPATH}/pkg/* && \
export latest_oc_client_version=$(curl https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/ 2>/dev/null | grep -o \"openshift-client-linux-4.*tar.gz\" | tr -d \") && \
curl -JL https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/${latest_oc_client_version} -o oc.tar.gz && \
tar -xzvf oc.tar.gz && \
mv oc /usr/local/bin/oc && \
rm -f oc.tar.gz && \
echo 'alias kubectl="oc"' >> ~/.bashrc && \
chmod -R 777 $HOME
RUN mkdir -p ${GOPATH}/src/${GO_PACKAGE_PATH}/ && \
chmod -R 775 ${GOPATH}
WORKDIR ${GOPATH}/src/${GO_PACKAGE_PATH}
ENTRYPOINT [ "/bin/bash" ]