dockcross: Ignore deletion error when running in unprivileged LXC container

This commit workarounds the problem described in [1] and [2] by ignoring error
happening when deleting container in unprivileged LXC container.

Fixes #50

[1] https://circleci.com/docs/docker-btrfs-error/
[2] https://discuss.circleci.com/t/docker-error-removing-intermediate-container/70
This commit is contained in:
Jean-Christophe Fillion-Robin 2016-10-26 23:24:25 -04:00
parent 32704fb4e4
commit 2e71db2234
No known key found for this signature in database
GPG Key ID: 15C1A2812F958BD3

View File

@ -180,12 +180,17 @@ fi
# Now, finally, run the command in a container
#
tty -s && TTY_ARGS=-ti || TTY_ARGS=
docker run $TTY_ARGS --rm \
CONTAINER_NAME=dockcross
docker run $TTY_ARGS --name $CONTAINER_NAME \
-v $PWD:/work \
$USER_IDS \
$FINAL_ARGS \
$FINAL_IMAGE "$@"
docker rm -f $CONTAINER_NAME > /dev/null && \
echo "Successfull removed container: $CONTAINER_NAME" || \
(echo "Failed to remove container: Ignoring error" && true)
################################################################################
#
# This image is not intended to be run manually.