Giter VIP home page Giter VIP logo

docker_lessons's Introduction

docker_lessons

Basic docker example, using mongo image and a example app

Docker basic commands

Images commands

  • List images
docker images

Or

docker image ls
  • Download image
docker pull [image]

Or

// specific tag
docker pull [image]:(tag)
  • Delete downloaded image

If there is a container created from an image that we want to remove, it will not work.

docker image rm [image]

Containers commands

  • List containers
docker ps

Or

docker container ls

Or
// -a flag will show stopped containers
docker container ls -a
  • Create container
docker create [image]

Important params:

--name [name] // it will set the desired name to container. If not specified, docker will assign a random name.
-p[host_port]:[container_port] // it will map host port to container port.
--network [network_name] // it will connect container to specified docker network.
-e [ENV_NAME]=[value] // it will set environment variable. Some images needs environment variables, read image the docs. 
  • Delete container
docker container rm [container_name]
  • Start container
docker start [container_name]
  • Delete container
docker stop [container_name]

Network commands

Networks are necesary to connect multiple containers.

  • List networks
docker network ls
  • Create network
docker network create [name]
  • Delete network
docker network rm [name]

docker_lessons's People

Contributors

pmoron94 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.