From 2124979644ef20d5f29e86b7fa94e15a28b83745 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 4 Mar 2024 05:36:41 +0000 Subject: [PATCH] feat: switch to the official dockerfile --- Dockerfile | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index dcc2417..35531b9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,37 @@ # Source(with modifications): https://github.com/ceph/go-ceph/blob/master/testing/containers/ceph/Dockerfile ARG CEPH_IMG=quay.io/ceph/ceph -ARG CEPH_TAG=v14.2.6 +ARG CEPH_TAG=v16 FROM ${CEPH_IMG}:${CEPH_TAG} +# A CEPH_VERSION env var is already set in the base image. +# We save our build arg as GO_CEPH_VERSION and later ensure that +# the values agree to ensure we're building what we meant to build. +ARG GO_CEPH_VERSION +ENV GO_CEPH_VERSION=${GO_CEPH_VERSION:-$CEPH_VERSION} + RUN true && \ - yum update -y && \ + echo "Check: [ ${CEPH_VERSION} = ${GO_CEPH_VERSION} ]" && \ + [ "${CEPH_VERSION}" = "${GO_CEPH_VERSION}" ] && \ + yum update -y --disablerepo=ganesha && \ cv="$(rpm -q --queryformat '%{version}-%{release}' ceph-common)" && \ yum install -y \ git wget curl make \ /usr/bin/cc /usr/bin/c++ \ - "libcephfs-devel-${cv}" "librados-devel-${cv}" "librbd-devel-${cv}" && \ + "libcephfs-devel-${cv}" "librados-devel-${cv}" "librbd-devel-${cv}" \ + gdb libcephfs2-debuginfo librados2-debuginfo librbd1-debuginfo && \ yum clean all && \ true -ENV GO_VERSION=1.20.6 - -COPY go1.20.6.linux-amd64.tar.gz /tmp/ - +ARG GO_VERSION=1.19.5 +ENV GO_VERSION=${GO_VERSION} +ARG GOARCH +ENV GOARCH=${GOARCH} +ARG GOPROXY +ENV GOPROXY=${GOPROXY} RUN true && \ - gotar=go1.20.6.linux-amd64.tar.gz && \ + gotar=go${GO_VERSION}.linux-${GOARCH}.tar.gz && \ + gourl="https://dl.google.com/go/${gotar}" && \ + curl -o /tmp/${gotar} "${gourl}" && \ tar -x -C /opt/ -f /tmp/${gotar} && \ rm -f /tmp/${gotar} && \ true @@ -27,10 +40,9 @@ ENV PATH="${PATH}:/opt/go/bin" ENV GOROOT=/opt/go ENV GO111MODULE=on ENV GOPATH /go -ENV GODEBUG=cgocheck=2 ENV GOCACHE=/go/cache -WORKDIR /opt/ceph-s3-operator -VOLUME /opt/ceph-s3-operator +WORKDIR /go/src/github.com/ceph/go-ceph +VOLUME /go/src/github.com/ceph/go-ceph COPY micro-osd.sh / COPY entrypoint.sh /