Skip to content

Commit

Permalink
Dockerfiles: Move package verification after clean
Browse files Browse the repository at this point in the history
It is most safe to check that no packages have been cleaned after the
cleaning process is over, as a flavor may remove packages at any point
during cleaning.

Add a __DOCKERFILE_VERIFY_PACKAGES__ step to the daemon and base
Dockerfiles after the cleaning step has finished to accomplish this.
Move all flavor verification steps to a corresponding
__DOCKERFILE_VERIFY_PACKAGES__ variable file.

Signed-off-by: Blaine Gardner <[email protected]>
  • Loading branch information
BlaineEXE authored and leseb committed May 10, 2018
1 parent 80c40bd commit 1188398
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rpm -q __CEPH_BASE_PACKAGES__
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
yum clean all && \
rpm -q __DAEMON_PACKAGES__
yum clean all
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rpm -q __DAEMON_PACKAGES__
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
__ZYPPER__ info __PACKAGES__ && \
rm -f /var/log/zypper.log
rm -f /var/log/zypper.log
1 change: 1 addition & 0 deletions ceph-releases/ALL/opensuse/__DOCKERFILE_VERIFY_PACKAGES__
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rpm --query __PACKAGES__
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rpm -q __CEPH_BASE_PACKAGES__
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rpm -q __DAEMON_PACKAGES__
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
apt-cache show __CEPH_BASE_PACKAGES__
Original file line number Diff line number Diff line change
@@ -1 +1 @@
apt-cache show __CEPH_BASE_PACKAGES__
/bin/true
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
apt-cache show __DAEMON_PACKAGES__
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ echo "purge unneeded packages" && \
rm -rf /var/lib/apt/lists/* \
/var/cache/debconf/* \
/var/log/apt/ \
/var/log/dpkg.log &&\
apt-cache show __DAEMON_PACKAGES__
/var/log/dpkg.log
5 changes: 4 additions & 1 deletion src/daemon-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@ RUN \
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"
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__
5 changes: 4 additions & 1 deletion src/daemon/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ RUN \
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"
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__

#======================================================
# Add ceph-container files
Expand Down

0 comments on commit 1188398

Please sign in to comment.