-
Notifications
You must be signed in to change notification settings - Fork 82
/
Dockerfile
56 lines (50 loc) · 2.78 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
48
49
50
51
52
53
54
55
56
# 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/ubi9/ubi
#################################################################################
# DNF Package Install List
ARG DNF_LIST="\
jq \
tar \
gcc \
make \
git \
gpgme-devel \
libassuan-devel \
wget \
pigz \
procps-ng \
"
#################################################################################
# Build UBI8 Builder with multi-arch support
RUN set -ex \
&& ARCH=$(arch | sed 's|x86_64|amd64|g' | sed 's|aarch64|arm64|g') \
&& dnf install -y --nodocs --setopt=install_weak_deps=false ${DNF_LIST} \
&& dnf clean all -y \
&& GO_VERSION=go1.19.5 \
&& curl -sL https://golang.org/dl/${GO_VERSION}.linux-${ARCH}.tar.gz \
| tar xzvf - --directory /usr/local/ \
&& /usr/local/go/bin/go version \
&& ln -f /usr/local/go/bin/go /usr/bin/go
#################################################################################
# Link gcc to /usr/bin/s390x-linux-gnu-gcc as go requires it on s390x
RUN [ "$(arch)" == "s390x" ] \
&& ln /usr/bin/gcc /usr/bin/s390x-linux-gnu-gcc \
|| echo "Not running on s390x, skip linking gcc binary"
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."