Skip to content

Commit

Permalink
feat: switch to the official dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
1995parham committed Mar 4, 2024
1 parent 28fb8a6 commit 2124979
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 /
Expand Down

0 comments on commit 2124979

Please sign in to comment.