Skip to content

Commit 95a0013

Browse files
committed
Added more cleanup to the docker/run command
- Legacy-Id: 10439
1 parent 81d87f5 commit 95a0013

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

docker/run

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,19 @@ to the database files at a time. Quitting."
121121
if [ -n "$DOWNLOAD" ]; then
122122
(
123123
cd $(dirname $MYSQLDIR)
124-
wget -N https://www.ietf.org/lib/dt/sprint/ietf_utf8.bin.tar.bz2 && tar xjf ietf_utf8.bin.tar.bz2 && chmod -R go+rwX mysql
124+
wget -N $URL && tar xjf ietf_utf8.bin.tar.bz2 && chmod -R go+rwX mysql
125125
)
126126
[ -d "$MYSQLDIR" ] || die "The download seems to have failed; still no $MYSQLDIR. Giving up."
127127
else
128128
[ -d "$MYSQLDIR" ] || die "Expected $MYSQLDIR to exist, but it\ndidn't. Use '$program -d' to download and unpack the database."
129129
fi
130130

131131
docker run -ti -p 8000:8000 -v $HOME:/home/$WHO -v $MYSQLDIR:/var/lib/mysql -e USER=$WHO -e DATADIR=${parent#$HOME/}/data levkowetz/datatracker:latest
132-
latest=$(docker ps -lq)
132+
133133
echo "Committing changes in the container to an image:"
134+
latest=$(docker ps -lq)
134135
docker commit $latest levkowetz/datatracker:latest
136+
137+
echo "Cleaning up containers and images"
138+
docker rmi $(docker images -f dangling=true -q)
139+
docker rm $latest

0 commit comments

Comments
 (0)