Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Docker Cheat Sheet

Docker Cheat Sheet

Testing with goss and dgoss

On the Mac

  1. install goss

    curl -L -o /usr/local/bin/goss
    curl -L -o /usr/local/bin/dgoss
    chmod +rx /usr/local/bin/dgoss
  2. add the following line to your ~/.profile or .zshrc

    export GOSS_PATH=/usr/local/bin/goss
  3. within the directory that contains your Dockerfile (where you want to create a goss.yml with tests) run

    dgoss edit -p 8080:80 <IMAGE NAME>
  4. add some checks with goss a ... and quit the editor with exit

    goss a port 80
    goss a http http://localhost
  5. run the tests against the container with

    dgoss run <IMAGE NAME>

Docker in Docker on Mac

  1. Create a Docker image that contains the docker binary

    FROM ...
    RUN apt-get update
    RUN apt-get -y install
    ENV GOSS_PATH="/usr/local/bin/goss"
  2. Start a container and mount the docker socket and install docker binary

    mkdir /tmp/docker
    docker run -it -v /var/run/docker.sock:/var/run/docker.sock - /tmp/docker:/tmp <IMAGE NAME>


Docker Testing

Docker Administration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment