2020-04-18 16:55:23 +02: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-04-25 12:03:55 +02:00
FROM registry.fedoraproject.org/fedora:39
2020-04-18 16:55:23 +02:00
ARG GOPATH = /go
2021-12-09 11:09:03 +05:30
ARG GOROOT = /usr/local/go
2021-12-14 09:46:47 +05:30
ARG GOARCH
2020-04-18 16:55:23 +02:00
ENV \
GOPATH = ${ GOPATH } \
2021-12-09 11:09:03 +05:30
GOROOT = ${ GOROOT } \
2020-04-18 16:55:23 +02:00
GO111MODULE = on \
2022-05-09 10:09:05 +05:30
CEPHCSIPATH = /go/src/github.com/ceph/ceph-csi \
2021-12-09 12:02:23 +05:30
PATH = " ${ GOPATH } /bin: ${ GOROOT } /bin:/opt/commitlint/node_modules/.bin: ${ PATH } "
2020-04-18 16:55:23 +02:00
2020-06-22 14:06:43 +02:00
COPY build.env /
2023-12-19 10:03:45 +01:00
RUN mkdir /etc/selinux || true && touch /etc/selinux/config
2020-06-22 14:06:43 +02:00
RUN source /build.env \
2021-12-14 09:46:47 +05:30
&& \
( 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 14:06:43 +02:00
&& dnf -y install \
2020-04-18 16:55:23 +02:00
git \
make \
gcc \
2021-12-09 12:02:23 +05:30
findutils \
2020-04-18 16:55:23 +02:00
librados-devel \
2023-11-21 19:49:24 +05:30
libcephfs-devel \
2020-04-18 16:55:23 +02:00
librbd-devel \
2022-11-15 18:02:19 +01:00
openssl \
2024-05-17 09:25:21 +02:00
ruby-devel \
2020-04-18 16:55:23 +02:00
rubygems \
ShellCheck \
2021-12-09 12:02:23 +05:30
codespell \
2020-04-18 16:55:23 +02:00
yamllint \
2020-05-13 14:02:03 +02:00
npm \
2020-12-03 20:37:18 +01:00
diffutils \
2021-12-09 12:02:23 +05:30
python3-prettytable \
pylint \
2020-04-18 16:55:23 +02:00
&& dnf -y update \
&& dnf -y clean all \
&& gem install mdl \
2021-12-09 11:09:03 +05:30
&& mkdir -p ${ GOROOT } \
2021-12-14 09:46:47 +05:30
&& curl https://storage.googleapis.com/golang/go${ GOLANG_VERSION } .linux-${ GOARCH } .tar.gz \
2021-12-09 11:09:03 +05:30
| tar xzf - -C ${ GOROOT } --strip-components= 1 \
2021-12-22 19:06:32 +05:30
&& curl -sf " https://raw.githubusercontent.com/golangci/golangci-lint/ ${ GOLANGCI_VERSION } /install.sh " \
2020-04-18 16:55:23 +02:00
| bash -s -- -b ${ GOPATH } /bin " ${ GOLANGCI_VERSION } " \
2023-05-22 09:30:40 +02:00
&& curl -L " ${ HELM_SCRIPT } " | bash -s -- --version " ${ HELM_VERSION } " \
2020-05-13 14:02:03 +02:00
&& mkdir /opt/commitlint && pushd /opt/commitlint \
&& npm init -y \
2021-07-29 16:17:52 +05:30
&& npm install @commitlint/cli@" ${ COMMITLINT_VERSION } " \
2020-05-13 14:02:03 +02:00
&& popd \
2022-05-09 10:09:05 +05:30
&& git config --global --add safe.directory ${ CEPHCSIPATH } \
2023-11-07 15:06:14 +01:00
&& go install github.com/augmentable-dev/tickgit/cmd/tickgit@latest \
2020-04-18 16:55:23 +02:00
&& true
2022-05-09 10:09:05 +05:30
WORKDIR ${CEPHCSIPATH}