Giter Club home page Giter Club logo

dockerdemo's Introduction

dockerdemo

In this repository you can find a demo to create a docker image based on ubuntu with python3.7, postgreSQL and nginx installed

Build docker image and run

Open a terminal and run this command to pull the image

docker pull davidezanin/demodocker:x.x.x

To create the docker image, docker file should be in this folder, use release version instead of x.x.x (e.g. RELEASE=7.1.5):

docker build --build-arg RELEASE=x.x.x -t davidezanin/demodocker:x.x.x .

To create and start the container:

sudo docker run -d --name demodockerContainer -p 80:80 davidezanin/demodocker:x.x.x

To create and start the container using the console (example to try flat project):

sudo docker run -it --name demodockerContainer -p 80:80 davidezanin/demodocker:x.x.x /bin/sh

To start after the first run:

docker start demodockerContainer

To stop:

docker stop demodockerContainer

Inspect and run commands

To inspect:

docker inspect demodockerContainer

To open bash (or running command) on running container in detached mode

docker exec -i -t demodockerContainer bash

List containers/images

List running containers:

docker ps

List all containers:

docker ps -a

List all images:

docker images

Delete Containers/images

Delete containers:

docker rmi <ContainerID1> <ContainerID2> ...

Delete images:

docker rmi <ImageID1> <ImageID2> ...

Delete all images:

docker rmi $(docker images -q)

Delete all containers:

docker rm $(docker ps -a -q)

Delete dangling images:

docker rmi -f $(docker images -f "dangling=true" -q)

Delete - all stopped containers, - all networks not used by at least one container, - all volumes not used by at least one container, - all dangling images, - all dangling build cache , - and with the option --volumes also unused volumes,

docker system prune --volumes

##Push on dockerhub

Push images on dockerhub (tagged during build):

docker login docker push davidezanin/demodocker

dockerdemo's People

Contributors

dzanin 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.