2020-06-22 13:54:18 +00:00
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
2019-12-30 19:47:02 +00:00
2020-04-20 15:24:37 +00:00
ARG GOROOT = /usr/local/go
2021-12-14 04:14:47 +00:00
ARG GOARCH
2020-04-20 15:24:37 +00:00
2020-03-31 05:29:25 +00:00
ENV GOPATH = /go \
2020-04-20 15:24:37 +00:00
GOROOT = ${ GOROOT } \
GO111MODULE = on \
PATH = " ${ GOROOT } /bin: ${ GOPATH } /bin: ${ PATH } "
2020-04-07 12:46:49 +00:00
2020-06-22 10:19:37 +00:00
COPY build.env /
RUN source /build.env \
2021-12-14 04:14:47 +00:00
&& \
( 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 10:19:37 +00:00
&& mkdir -p /usr/local/go \
2021-12-14 04:14:47 +00:00
&& curl https://storage.googleapis.com/golang/go${ GOLANG_VERSION } .linux-${ GOARCH } .tar.gz | tar xzf - -C ${ GOROOT } --strip-components= 1
2019-12-30 19:47:02 +00:00
2023-11-07 09:44:35 +00: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 15:43:27 +00:00
RUN dnf config-manager --disable \
2023-11-07 09:44:35 +00:00
tcmu-runner,tcmu-runner-source,tcmu-runner-noarch,ceph-iscsi,ganesha || true
2023-07-03 15:43:27 +00:00
2024-12-02 12:02:15 +00:00
RUN mkdir -p /etc/selinux && touch /etc/selinux/config
2023-12-19 09:03:45 +00:00
2024-10-22 11:18:44 +00:00
# other/conflicting versions of protobuf get installed as dependency
RUN dnf -y remove protobuf
2020-04-20 15:22:19 +00:00
RUN dnf -y install \
2020-03-31 05:29:25 +00:00
git \
2019-12-30 19:47:02 +00:00
make \
2020-04-07 12:46:49 +00:00
gcc \
2019-12-30 19:47:02 +00:00
librados-devel \
2023-11-21 14:19:24 +00:00
libcephfs-devel \
2019-12-30 19:47:02 +00:00
librbd-devel \
2024-12-10 11:22:51 +00:00
&& dnf -y --nobest update \
2022-03-16 12:20:46 +00:00
&& dnf clean all \
&& rm -rf /var/cache/yum \
2019-12-30 19:47:02 +00:00
&& true
2020-04-20 15:30:11 +00:00
WORKDIR "/go/src/github.com/ceph/ceph-csi"