2020-04-18 14:55:23 +00:00
# Container image for running the Ceph-CSI tests
#
# This container is based on Fedora so that recent versions of tools can easily
# be installed.
#
# Production containers are based one ceph/ceph:latest, which use CentOS as
# Operating System, so generated binaries and versions of dependencies may be a
# little different.
#
2024-07-31 12:59:44 +00:00
FROM registry.fedoraproject.org/fedora:latest
2020-04-18 14:55:23 +00:00
ARG GOPATH = /go
2021-12-09 05:39:03 +00:00
ARG GOROOT = /usr/local/go
2021-12-14 04:16:47 +00:00
ARG GOARCH
2020-04-18 14:55:23 +00:00
ENV \
GOPATH = ${ GOPATH } \
2021-12-09 05:39:03 +00:00
GOROOT = ${ GOROOT } \
2020-04-18 14:55:23 +00:00
GO111MODULE = on \
2022-05-09 04:39:05 +00:00
CEPHCSIPATH = /go/src/github.com/ceph/ceph-csi \
2021-12-09 06:32:23 +00:00
PATH = " ${ GOPATH } /bin: ${ GOROOT } /bin:/opt/commitlint/node_modules/.bin: ${ PATH } "
2020-04-18 14:55:23 +00:00
2020-06-22 12:06:43 +00:00
COPY build.env /
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
2020-06-22 12:06:43 +00:00
RUN source /build.env \
2021-12-14 04:16:47 +00:00
&& \
( test -n " ${ GOARCH } " && exit 0; echo -e "\n\nMissing GOARCH argument for building image, install Golang or run: make containerized-test GOARCH=amd64\n\n" ; exit 1 ) \
2020-06-22 12:06:43 +00:00
&& dnf -y install \
2020-04-18 14:55:23 +00:00
git \
make \
gcc \
2021-12-09 06:32:23 +00:00
findutils \
2020-04-18 14:55:23 +00:00
librados-devel \
2023-11-21 14:19:24 +00:00
libcephfs-devel \
2020-04-18 14:55:23 +00:00
librbd-devel \
2022-11-15 17:02:19 +00:00
openssl \
2024-05-17 07:25:21 +00:00
ruby-devel \
2020-04-18 14:55:23 +00:00
rubygems \
ShellCheck \
2021-12-09 06:32:23 +00:00
codespell \
2020-04-18 14:55:23 +00:00
yamllint \
2020-05-13 12:02:03 +00:00
npm \
2020-12-03 19:37:18 +00:00
diffutils \
2021-12-09 06:32:23 +00:00
python3-prettytable \
pylint \
2020-04-18 14:55:23 +00:00
&& dnf -y update \
&& dnf -y clean all \
&& gem install mdl \
2021-12-09 05:39:03 +00:00
&& mkdir -p ${ GOROOT } \
2021-12-14 04:16:47 +00:00
&& curl https://storage.googleapis.com/golang/go${ GOLANG_VERSION } .linux-${ GOARCH } .tar.gz \
2021-12-09 05:39:03 +00:00
| tar xzf - -C ${ GOROOT } --strip-components= 1 \
2021-12-22 13:36:32 +00:00
&& curl -sf " https://raw.githubusercontent.com/golangci/golangci-lint/ ${ GOLANGCI_VERSION } /install.sh " \
2020-04-18 14:55:23 +00:00
| bash -s -- -b ${ GOPATH } /bin " ${ GOLANGCI_VERSION } " \
2023-05-22 07:30:40 +00:00
&& curl -L " ${ HELM_SCRIPT } " | bash -s -- --version " ${ HELM_VERSION } " \
2020-05-13 12:02:03 +00:00
&& mkdir /opt/commitlint && pushd /opt/commitlint \
&& npm init -y \
2021-07-29 10:47:52 +00:00
&& npm install @commitlint/cli@" ${ COMMITLINT_VERSION } " \
2020-05-13 12:02:03 +00:00
&& popd \
2022-05-09 04:39:05 +00:00
&& git config --global --add safe.directory ${ CEPHCSIPATH } \
2023-11-07 14:06:14 +00:00
&& go install github.com/augmentable-dev/tickgit/cmd/tickgit@latest \
2020-04-18 14:55:23 +00:00
&& true
2022-05-09 04:39:05 +00:00
WORKDIR ${CEPHCSIPATH}