Giter Site home page Giter Site logo

docker-cheatsheet's Introduction

Docker-cheatsheet

Build a Docker image docker build -t [image_name]:[tag] .

Run a Docker container specifying a name docker run --name [container_name] [image_name]:[tag]

Fetch the logs of a container docker logs -f [container_id_or_name]

Run a command in a running container docker exec -it [container_id_or_name] bash

Show running containers docker ps

Show all containers docker ps -a

Show Docker images docker images

Stop a Docker container docker stop [container_id_or_name]

Remove a Docker container docker rm [container_id_or_name]

Remove a Docker image docker rmi [image_id_or_name]

docker file/location/in/base/os container-id:/file-location </br>

Remove untagged Docker images docker image prune -fa

Docker tensorflow run Need nvidia-docker installed to run gpu on containers
Nvidia-docker: https://github.com/NVIDIA/nvidia-docker/wiki/Installation-(version-2.0)

docker run --runtime=nvidia -it --rm tensorflow/tensorflow:devel-gpu-py3 bash <br/>

Jupyter notebook with Docker

install notebook on docker image as: pip install notebook

Run follwing command to run docker image docker run -it --rm -p 8080:8080 image </br>

Following command start notebook jupyter notebook --ip 0.0.0.0 --no-browser --allow-root </br>

Install graphviz on Docker to render images in notebook.

pip install graphviz

Run (ref)

apt-get update \
  && apt-get install -yq --no-install-recommends libfuse-dev nano fuse vim git \
  && apt-get install -yq --no-install-recommends libfuse-dev nano fuse vim git graphviz \
  && apt-get clean \
  && rm -rf /var/lib/apt/lists/*
USER $NB_USER 

Push Docker image to Docker hub

docker tag id [name]

docker push [name]

docker-cheatsheet's People

Contributors

abdulwahabamin avatar mohbattharani 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.