Posts Tagged ‘docker’

Debugging your gitlab-ci.yml in docker

June 26, 2018 Leave a comment

Because gitlab-runner exec does not support submodules, is deprecated and that the alternative is not yet ready I changed my way of debugging .gitlab-ci.yml files. Here is my recipe:

- set +e
- ...
- sleep 100d
  • wait for the crash
  • connect to the container using the following alias, and find what’s going on:
alias docker_exec_last='docker exec -e COLUMNS=$(tput cols) \
 -e LINES=$(tput lines) -it $(docker ps -ql -f status=running) bash'

This alias also contains a workaround for a docker exec bug about TTY sizing.

Tags: ,

Docker container of host OS without image

March 12, 2017 Leave a comment

I often need to check that my applications binary distribution embed all its shared libraries so it can work on all distros. I used to do this with chroot and mount --bind but it’s much easier with Docker:

tar cT /dev/null | docker import - empty
docker run -v /lib:/lib:ro -v /path/to/my/app:/opt/app -it empty /opt/app/bin/app

This create an empty Docker image then run a container with only /lib mounted from the host.