forked from openshift/oc-mirror
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
47 lines (42 loc) · 2.48 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
39
40
41
42
43
44
45
46
47
# docker build -f Dockerfile -t local/go-toolset .
# docker run -it --rm --privileged -v ${PWD}:/build:z local/go-toolset
#################################################################################
# Builder Image
FROM registry.access.redhat.com/ubi8/ubi
#################################################################################
# DNF Package Install List
ARG DNF_LIST="\
jq \
tar \
gcc \
make \
git \
"
#################################################################################
# Build UBI8 Builder
RUN set -ex \
&& dnf install -y --nodocs --setopt=install_weak_deps=false ${DNF_LIST} \
&& dnf clean all -y \
&& GO_VERSION=$(curl -sL https://golang.org/dl/?mode=json \
| jq -r '.[].files[] | select(.os == "linux").version' \
| grep -v -E 'go[0-9\.]+(beta|rc)' \
| sort -V | tail -1) \
&& curl -sL https://golang.org/dl/${GO_VERSION}.linux-amd64.tar.gz \
| tar xzvf - --directory /usr/local/ \
&& /usr/local/go/bin/go version \
&& ln -f /usr/local/go/bin/go /usr/bin/go
WORKDIR /build
ENTRYPOINT ["make"]
CMD []
ENV PATH="/root/platform/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
LABEL \
name="go-toolset" \
license=GPLv3 \
distribution-scope="public" \
io.openshift.tags="go-toolset" \
summary="oc-mirror compiler image" \
io.k8s.display-name="go-toolset" \
build_date="`date +'%Y%m%d%H%M%S'`" \
project="https://github.com/openshift/oc-mirror" \
description="oc-mirror is an OpenShift Client (oc) plugin that manages OpenShift release, operator catalog, helm charts, and associated container images. This image is designed to build the binary." \
io.k8s.description="oc-mirror is an OpenShift Client (oc) plugin that manages OpenShift release, operator catalog, helm charts, and associated container images. This image is designed to build the binary."