Skip to content

GitlabCIDeps

Kelly (KT) Thompson edited this page Aug 15, 2018 · 7 revisions

Docker

We currently use docker to generate the Ubuntu OS image used for Travis-based CI testing. Instructions for creating the docker image are here:

  1. Install Docker

  2. Create an account on dockerhub.com.

  3. Primer/How-to

    • Ref: https://www.techrepublic.com/article/how-to-create-a-docker-image-and-push-it-to-docker-hub/
    • Start a CMD shell
    • Start with a basic OS image: docker pull ubuntu:latest, or try the ci image: docker pull kinetictheory/draco-travis-ci
    • Use the image for an interactive Linux session: docker run --name draco-travis-ci -it ubuntu:latest /bin/bash -l
    • Once the image has been modified, save the changes: docker commit -m "Installed newer cmake" -a <docker-moniker> docker-travis-ci <docker-moniker>/draco-travis-ci:latest
    • Now that the changes are queued for upload. When ready finish uploading to dockerhub.com:
      • docker login (provide docker-moniker and password)
      • docker push <docker-moniker>/draco-travis-ci
  4. Examine the existing CI image.

    • Download the current image:
      • docker login -u <docker-moniker> (and provide password)
      • `docker pull kinetictheory/draco-travis-ci
    • Run an interactive session: docker run -it kinetictheory/draco-travis-ci /bin/bash -l
    • Run a script inside the docker image while accessing local files: docker run -it -v c:/myworkdir/draco::/home/travis/draco -w /home/travis/draco kinetictheory/draco-travis-ci /bin/bash -l -c ./.travis-run-tests.sh
  5. Look at locally available images:

    • docker ps -a [-q]
    • docker rm <hash>
    • docker kill <image-name>
  6. Build an image based on a Dockerfile script found in CWD.

Clone this wiki locally