Skip to content

Instantly share code, notes, and snippets.

@mrjazz
Created May 5, 2016 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrjazz/51cdcd6304cd9ce51615601d2c319930 to your computer and use it in GitHub Desktop.
Save mrjazz/51cdcd6304cd9ce51615601d2c319930 to your computer and use it in GitHub Desktop.

Installation

https://docs.docker.com/v1.8/installation/ubuntulinux/

Common commands

Pull from docker repository: docker pull {name}

Force remove image: docker rmi -f {name}

Commit in container: docker commit {id} {tag}

List of running containers with port mapping: docker ps -l

Start webserver and forward it on port 80: docker run -d -p 80:5000 python -m SimpleHTTPServer 8000

Follow mode for logs: docker logs -f nostalgic_morse

Details about docker container: docker inspect nostalgic_morse

Set tag for existing image: docker tag 5db5f8471261 ouruser/sinatra:devel

Run docker on Windows: docker run -i -t ubuntu //bin/bash

Attach to running container: docker attach NAME

Registry

https://docs.docker.com/registry/deploying/

Permissions for cert: chmod 600 ~/WPNew2016.pem ssh -i ~/WPNew2016.pem -N -L 5000:localhost:5000 ubuntu@54.215.12.221

Run resistry: docker run -d -p 5000:5000 --restart=always --name registry registry:2

Stop and remove docker registry: docker stop registry && docker rm -v registry

Tag for push in repository docker tag postgres localhost:5000/postgres

Push in repository docker push localhost:5000/postgres

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