Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
pull docker images so they update if changed
Browse files Browse the repository at this point in the history
  • Loading branch information
micahnz committed Mar 23, 2018
1 parent b741733 commit 6dc29cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docker-flexvol.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ domount() {
VOLUME_IMAGE=$(echo $2 | jq -r '.image')
VOLUME_NAME=$(echo $2 | jq -r '.name | select(type!="null")')

docker pull $VOLUME_IMAGE &> /dev/null # check for image updates

if [[ -z "${VOLUME_NAME}" ]]; then
VOLUME_CONTAINER_ID=$(docker create --name $UUID $VOLUME_IMAGE /bin/true)
if [[ -z "${VOLUME_CONTAINER_ID}" ]]; then
Expand Down Expand Up @@ -96,7 +98,6 @@ unmount() {
if [[ -n "${VOLUME_ID}" ]]; then
# Hack to get the container id from the volume id (See https://github.com/moby/moby/issues/31436)
VOLUME_CONTAINER_ID=$(docker volume rm $VOLUME_ID 2>&1 | sed 's/.*\[\([^]]*\)\].*/\1/g')

umount ${MNTPATH} &> /dev/null
if [ $? -ne 0 ]; then
err "{ \"status\": \"Failed\", \"message\": \"Failed to unmount volume at ${MNTPATH}\"}"
Expand Down

0 comments on commit 6dc29cd

Please sign in to comment.