Skip to content

Instantly share code, notes, and snippets.

@daniel-garcia
Created May 6, 2014 15:26
Show Gist options
  • Save daniel-garcia/fb4831f4d52b761356d4 to your computer and use it in GitHub Desktop.
Save daniel-garcia/fb4831f4d52b761356d4 to your computer and use it in GitHub Desktop.
recreate issue when commiting running container that has a file based bind mount
#!/usr/bin/env bash
set -e
docker pull ubuntu:latest
touch somefile.txt
WD=`pwd`
echo "about to run docker image in the background"
CONTAINERID=`docker run -d -v $WD/somefile.txt:/somefile.txt ubuntu sleep 100`
echo "giving some time for container to start"
sleep 3
echo "about to commit $CONTAINERID to image bindErrImage"
docker commit $CONTAINERID binderrimg
echo "about to create new container with bindErrImage"
docker run binderrimg hostname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment