mirror of
https://github.com/bensuperpc/dockcross.git
synced 2024-12-22 16:24:27 +01:00
dockcross: Ensure deletion error are ignored
This commit follows up on 2e71db2
(dockcross: Ignore deletion error
when running in unprivileged LXC container) by hiding the message
only when (a) the command output matches the expected error message
and (b) is executed on CircleCI.
Doing so will avoid adding "noise" to log of service like CircleCI
that are effectively running docker in unprivileged LXC container.
See #50
This commit is contained in:
parent
0926d89d99
commit
c0fe1e2313
@ -205,10 +205,17 @@ docker run $TTY_ARGS --name $CONTAINER_NAME \
|
||||
$FINAL_IMAGE "$@"
|
||||
run_exit_code=$?
|
||||
|
||||
# Deleting the container while ignoring error is required because of
|
||||
# https://circleci.com/docs/docker-btrfs-error/.
|
||||
# See issue dockcross/dockcross#50 for more details.
|
||||
docker rm -f $CONTAINER_NAME > /dev/null || true
|
||||
# Attempt to delete container
|
||||
rm_output=$(docker rm -f $CONTAINER_NAME 2>&1)
|
||||
rm_exit_code=$?
|
||||
if [[ $rm_exit_code != 0 ]]; then
|
||||
if [[ "$CIRCLECI" == "true" ]] && [[ $rm_output == *"Driver btrfs failed to remove"* ]]; then
|
||||
: # Ignore error because of https://circleci.com/docs/docker-btrfs-error/
|
||||
else
|
||||
echo "$rm_output"
|
||||
exit $rm_exit_code
|
||||
fi
|
||||
fi
|
||||
|
||||
exit $run_exit_code
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user