Thursday, July 8, 2021

Docker-Learn1

https://itnext.io/chroot-cgroups-and-namespaces-an-overview-37124d995e3d

https://www.youtube.com/watch?v=8fi7uSYlOdc

https://www.docker.com/play-with-docker



https://www.docker.com/101-tutorial     [<<<<<<<<<<<<<<<BEGIN Here<<<<<<<<<<<<]

docker run -dp 80:80 docker/getting-started 


docker <command> --help

docker run -d -p --rm -it IMAGE "startupCommand"

-d        detached mode in console

-p       HostPort:DockerPort

-i         make it interactive

-t        make a pseudo tty

--rm   remove once container stopped/exited

docker start containerID

docker stop ContainerID

docker rm containerID

docker ps -a

docker ps 


CONTAINERID          IMAGE           COMMAND             CREATED          STATUS          PORTS             NAMES


docker rm 10c997a681fa


https://towardsdatascience.com/learn-enough-docker-to-be-useful-b0b44222eef5

https://www.freecodecamp.org/news/a-beginner-friendly-introduction-to-containers-vms-and-docker-79a9e3e119b/


https://phoenixnap.com/kb/grep-command-linux-unix-examples


Recall that a Docker container is a Docker image brought to life

A Dockerfile instruction is a capitalized word at the start of a line followed by its arguments. Each line in a Dockerfile can contain an instruction.


Only the instructions FROM, RUN, COPY, and ADD create layers in the final image. 

Other instructions configure things, add metadata, or tell Docker to do something at run time, such as expose a port or run a command



Some docker commands have subcommands

Example

docker image ls

docker image rm 

docker image build

docker image pull


docker pull hello-world

docker rm 057c5b1edd19 2da87d301ae6


An image being referenced by container cannot be removed even if a container is itself "Exited/Stopped"

You have to either rm the container or use -force with image

docker rm CONTAINERID 

docker image rm image1 image2



No comments:

Post a Comment

Azure - Pipeline - Add Approver for Stage

https://learn.microsoft.com/en-us/azure/devops/pipelines/process/approvals?view=azure-devops&tabs=check-pass