-
Notifications
You must be signed in to change notification settings - Fork 524
/
Dockerfile
59 lines (50 loc) · 2.38 KB
/
Dockerfile
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
# CEPH DAEMON IMAGE
FROM __ENV_[DAEMON_BASE_IMAGE]__
__DOCKERFILE_TRACEABILITY_LABELS__
#======================================================
# Install ceph and dependencies, and clean up
#======================================================
__DOCKERFILE_PREINSTALL__
# Escape char after immediately after RUN allows comment in first line
RUN \
# Install all components for the image, whether from packages or web downloads.
# Typical workflow: add new repos; refresh repos; install packages; package-manager clean;
# download and install packages from web, cleaning any files as you go.
__DOCKERFILE_INSTALL__ && \
# Clean container, starting with record of current size (strip / from end)
INITIAL_SIZE="$(bash -c 'sz="$(du -sm --exclude=/proc /)" ; echo "${sz%*/}"')" && \
#
#
# Perform any final cleanup actions like package manager cleaning, etc.
__DOCKERFILE_POSTINSTALL_CLEANUP__ && \
# Clean daemon-specific files
__DOCKERFILE_CLEAN_DAEMON__ && \
# Clean common files like /tmp, /var/lib, etc.
__DOCKERFILE_CLEAN_COMMON__ && \
#
#
# Report size savings (strip / from end)
FINAL_SIZE="$(bash -c 'sz="$(du -sm --exclude=/proc /)" ; echo "${sz%*/}"')" && \
REMOVED_SIZE=$((INITIAL_SIZE - FINAL_SIZE)) && \
echo "Cleaning process removed ${REMOVED_SIZE}MB" && \
echo "Dropped container size from ${INITIAL_SIZE}MB to ${FINAL_SIZE}MB" && \
#
# Verify that the packages installed haven't been accidentally cleaned
__DOCKERFILE_VERIFY_PACKAGES__ && echo 'Packages verified successfully'
#======================================================
# Add ceph-container files
#======================================================
# Add templates for confd
ADD ./confd/templates/* /etc/confd/templates/
ADD ./confd/conf.d/* /etc/confd/conf.d/
# Add bootstrap script, ceph defaults key/values for KV store
ADD *.sh check_zombie_mons.py ./osd_scenarios/* entrypoint.sh.in disabled_scenario /opt/ceph-container/bin/
ADD ceph.defaults /opt/ceph-container/etc/
# ADD *.sh ceph.defaults check_zombie_mons.py ./osd_scenarios/* entrypoint.sh.in disabled_scenario /
# Modify the entrypoint
RUN bash "/opt/ceph-container/bin/generate_entrypoint.sh" && \
rm -f /opt/ceph-container/bin/generate_entrypoint.sh && \
bash -n /opt/ceph-container/bin/*.sh
# Execute the entrypoint
WORKDIR /
ENTRYPOINT ["/opt/ceph-container/bin/entrypoint.sh"]