$ docker --version
$ docker info // see more information about the Docker daemon, such as the number of containers and images
- .img: use Win32DiskImager to flash the SD card
- .iso: use Etcher to flash the SD card
- Run ros melodic on ubuntu 16.04 with ros kinetic on board
- Help people use microsoft office specific version on a certain machine
- If you're running out of RAM when doing something in docker, and PyTorch is saying you should increase your
shared memory.. before adding any configurations to your 'docker run' be sure to include --shm-size + the size you want in mb or gb - ex:
docker run --shm-size=24G -p 8886:8886 --gpus all jupyter-extensions ..
- Gracefully stop container
$ docker container stop <container id>
- Force shutdown of container
$ docker container kill <hash>
- A container includes:
- Code
- Configs
- Processes
- Networking
- Dependencies
- Operating System
- Libraries
- Runtime
- Environment Variables
- Can reproduce results
- Carves up a computer into sealed computers that run your code
- Gets the code to and from your computers
- Builds these containers for you
- IS a social platform for you to find and share containers, which are different from virtual machines
- A container is a self-contained sealed unit of software, contains everything required to run the code.. includes batteries and operating systems
- A client program named docker
- A server program that manages a Linux System
- A program that builds containers from code
- A container is a running docker image
- Needs a Server Docker Daemon
- Docker needs a Linux server to manage
- Many people use a virtual machine on their laptop
- Docker helps run this Linux virtual machine
- IF you have Boot2Docker installed, you most remove it first
- You are going to need to use the docker images from Nvidia's website
- Docker File (a list of text that usually defines the dependencies) [Build] -> Docker Image [Run] -> Container
- Docker Registry [Push/Pull] with the Docker Image
$ curl -fsSL https://get.docker.com -o get-docker.sh && chmod +777 get-docker.sh && ./get-docker.sh
$ docker pull hello-world
$ docker pull ubuntu
$ docker pull ubuntu:18.10
$ docker image ls
$ docker image ls -a
$ docker image rm <image id>
$ docker image rm $(docker image ls -a -q)
$ docker container ls # list all running docker containers
$ docker container ls -a # list all containers, even those not running
$ docker ps
$ docker images
$ docker container stop <container id> # gracefully stop container
$ docker container kill <hash> # force shutdown of container
$ docker build -t <image_name> .
$ docker container run image_name
$ docker container run -it image_name
$ FROM <image>
- example: FROM ubuntu:18.10
$ LABEL version="0.1"
$ LABEL description=" Notebook and data (.csv file) to provide a summary /
of the total medals won by participating countries /
in the 2008 summer Olympics."
$ WORKDIR /data # always use absolute paths, if not specified it will create one by default
$ COPY <src> <dest>
- example: COPY . /data
$ RUN pip install jupyter
$ RUN pip install pandas
$ RUN pip install matplotlib
OR
$ RUN pip install jupyter &&/
pip install pandas &&/
pip install matplotlib
$ EXPORT <port>
- example: EXPOSE 8888
$ CMD ["jupyter", "notebook", "--ip=0.0.0.0", :--port=8888", "--no-browser", "--allow-root"] # run jupyter at start
- can only have one CMD command, if more than one exists it will run the last one
- CMD tells it what to run at start
- Containers are built on top of containers, once you get a bug while building from a docker file you can log into the linux shell machine with the command below using the debugging ID
$ docker container run -it 56908d9dce45 /bin/bash
$ docker login
>> Username: HusseinLezzaik
>> Password: sample
$ docker image ls
$ docker push hello-world:latest # latest as a TAG
$ docker image rm -fce # force delete cz kaza image with same ID
$ docker pull <image_name>
$ docker image ls
$ docker container run <image_name>
- Consider the case where your project consists of featurizing code that is fast to run but requires a lot of memory, and the model training code that is slow to run but requires less memory.
- If you run both parts of the code on the same GPU instances, you'll need GPU instances with high memory, which can be very expensive.
- Instead, you can run your featurizing code on CPU instances and the model training code on GPU instances.
- This means you'll need a container for the featurizing instances and a container for the training instances.
- Different containers also might be necessary when differnt steps in your pipeline have conflicting dependencies, such as your featurizer code requires Numpy 0.8 but your model requires NumPy 1.0.
- When you have multiple containers with multiple instances, you might need to set up a network for them to communicate and share resources.
- You might also need a container orchestration tool to manage them and maintain high availability. Kubernetes is exactly that.