2020-06-22 15:54:18 +02:00
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
2019-12-30 20:47:02 +01:00
2024-06-04 10:54:29 +05:30
# Since CentOS Stream 8 is EOL, update the config to use vault.centos.org for CentOS Stream 8
# TODO: remove once https://github.com/ceph/ceph-csi/issues/4659 is fixed.
RUN sed -i 's|^mirrorlist=|#mirrorlist=|g' /etc/yum.repos.d/*.repo && \
sed -i 's|^#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/*.repo
2020-04-20 17:24:37 +02:00
ARG GOROOT = /usr/local/go
2021-12-14 09:44:47 +05:30
ARG GOARCH
2020-04-20 17:24:37 +02:00
2020-03-31 10:59:25 +05:30
ENV GOPATH = /go \
2020-04-20 17:24:37 +02:00
GOROOT = ${ GOROOT } \
GO111MODULE = on \
PATH = " ${ GOROOT } /bin: ${ GOPATH } /bin: ${ PATH } "
2020-04-07 18:16:49 +05:30
2020-06-22 12:19:37 +02:00
COPY build.env /
RUN source /build.env \
2021-12-14 09:44:47 +05:30
&& \
( test -n " ${ GOARCH } " && exit 0; echo -e "\n\nMissing GOARCH argument for building image, install Golang or run: make containerized-build GOARCH=amd64\n\n" ; exit 1 ) \
2020-06-22 12:19:37 +02:00
&& mkdir -p /usr/local/go \
2021-12-14 09:44:47 +05:30
&& curl https://storage.googleapis.com/golang/go${ GOLANG_VERSION } .linux-${ GOARCH } .tar.gz | tar xzf - -C ${ GOROOT } --strip-components= 1
2019-12-30 20:47:02 +01:00
2023-11-07 10:44:35 +01:00
# TODO: remove the following cmd, when issues
# https://github.com/ceph/ceph-container/issues/2034
# https://github.com/ceph/ceph-container/issues/2141 are fixed.
2023-07-03 17:43:27 +02:00
RUN dnf config-manager --disable \
2023-11-07 10:44:35 +01:00
tcmu-runner,tcmu-runner-source,tcmu-runner-noarch,ceph-iscsi,ganesha || true
2023-07-03 17:43:27 +02:00
2023-12-19 10:03:45 +01:00
RUN mkdir /etc/selinux || true && touch /etc/selinux/config
2020-04-20 17:22:19 +02:00
RUN dnf -y install \
2020-03-31 10:59:25 +05:30
git \
2019-12-30 20:47:02 +01:00
make \
2020-04-07 18:16:49 +05:30
gcc \
2019-12-30 20:47:02 +01:00
librados-devel \
2023-11-21 19:49:24 +05:30
libcephfs-devel \
2019-12-30 20:47:02 +01:00
librbd-devel \
2020-04-20 17:22:19 +02:00
&& dnf -y update \
2022-03-16 17:50:46 +05:30
&& dnf clean all \
&& rm -rf /var/cache/yum \
2019-12-30 20:47:02 +01:00
&& true
2020-04-20 17:30:11 +02:00
WORKDIR "/go/src/github.com/ceph/ceph-csi"