forked from ceph/ceph-nvmeof
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.ceph
131 lines (111 loc) · 3.14 KB
/
Dockerfile.ceph
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# syntax = docker/dockerfile:1.4
# vim: syntax=dockerfile
FROM quay.io/centos/centos:stream9-minimal AS build
ARG CEPH_CLUSTER_VERSION
ARG CEPH_CLUSTER_CEPH_REPO_BASEURL
ARG CEPH_CLUSTER_EPEL_REPO_URL="https://copr.fedorainfracloud.org/coprs/ceph/el9/repo/epel-9/ceph-el9-epel-9.repo"
ARG MICRODNF_OPTS="\
--enablerepo crb \
--nobest \
--nodocs \
--setopt=install_weak_deps=0 \
--setopt=keepcache=1 \
--setopt=cachedir=/var/cache/microdnf \
"
ARG CEPH_PACKAGES="\
ceph-common \
ceph-mon \
ceph-osd \
ceph-mds \
ceph-mgr \
ceph-mgr-dashboard \
ceph-radosgw \
ceph-exporter \
hostname \
jq \
net-tools \
iproute \
"
# TODO: To remove when ceph-mgr-dashboard defines these as deps
ARG EXTRA_PACKAGES="\
python3-grpcio\
python3-grpcio-tools \
"
ARG DEBUG_PACKAGES="\
procps-ng \
strace \
perf \
ltrace \
lsof \
"
RUN <<EOF
echo Log variables
echo ======================================================================
echo CEPH_CLUSTER_CEPH_REPO_BASEURL=$CEPH_CLUSTER_CEPH_REPO_BASEURL
echo CEPH_CLUSTER_VERSION=$CEPH_CLUSTER_VERSION
echo ======================================================================
EOF
COPY <<EOF /etc/yum.repos.d/ceph.repo
[Ceph]
name=Ceph packages for \$basearch
baseurl=${CEPH_CLUSTER_CEPH_REPO_BASEURL:-https://download.ceph.com/rpm-${CEPH_CLUSTER_VERSION}/el\$releasever}/\$basearch
enabled=1
priority=2
gpgcheck=0
[Ceph-noarch]
name=Ceph noarch packages
baseurl=${CEPH_CLUSTER_CEPH_REPO_BASEURL:-https://download.ceph.com/rpm-${CEPH_CLUSTER_VERSION}/el\$releasever}/noarch
enabled=1
priority=2
gpgcheck=0
EOF
RUN cat /etc/yum.repos.d/ceph.repo
RUN rpm -vih https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
RUN rpm --import 'https://download.ceph.com/keys/release.asc'
RUN curl -O --output-dir /etc/yum.repos.d/ ${CEPH_CLUSTER_EPEL_REPO_URL:?}
RUN --mount=type=cache,target=/var/cache/microdnf \
microdnf install -y $MICRODNF_OPTS \
$CEPH_PACKAGES \
$EXTRA_PACKAGES \
$DEBUG_PACKAGES
#------------------------------------------------------------------------------
FROM build
LABEL maintainer \
ceph=True \
RELEASE \
GIT_REPO \
GIT_BRANCH \
GIT_COMMIT
ENV MON=1 \
MGR=1 \
OSD=3 \
MDS=0 \
FS=0 \
RGW=0 \
NFS=0 \
CEPH_PORT=10000 \
CEPH_VSTART_ARGS="--memstore"
ENV CEPH_BIN=/usr/bin \
CEPH_LIB=/usr/lib64/ceph \
CEPH_CONF_PATH=/etc/ceph \
EC_PATH=/usr/lib64/ceph/erasure-code \
OBJCLASS_PATH=/usr/lib64/rados-classes \
MGR_PYTHON_PATH=/usr/share/ceph/mgr \
PYBIND=/usr/share/ceph/mgr
VOLUME $CEPH_CONF_PATH
RUN chown ceph:ceph $CEPH_CONF_PATH
RUN ln -sf $EC_PATH/* $CEPH_LIB && \
ln -sf $OBJCLASS_PATH/* $CEPH_LIB && \
ln -sf $CEPH_LIB/compressor/* $CEPH_LIB
USER ceph
WORKDIR /ceph
ADD --chown=ceph:ceph --chmod=755 \
https://raw.githubusercontent.com/ceph/ceph/v${CEPH_CLUSTER_VERSION:?}/src/vstart.sh .
COPY <<EOF ./CMakeCache.txt
ceph_SOURCE_DIR:STATIC=/ceph
WITH_MGR_DASHBOARD_FRONTEND:BOOL=ON
WITH_RBD:BOOL=ON
EOF
ENTRYPOINT \
./vstart.sh --new $CEPH_VSTART_ARGS && \
sleep infinity