You use this command to start a new @Docker container.
It accepts an image and a command as its arguments. The image is used to create the container. The command is the application the container will run when it starts.
For example, running the following command will start an ubuntu container and run the bash shell
docker container run -it ubuntu /bin/bash
Oh yea, the -it runs an interactive terminal. It attaches the containers terminal to your terminal.
2/ ctrl-PQ
This is how you detach your shell from the terminal of a @Docker container.
It doesn't stop or kill the container, but leaves it up and running in the background.
3/ docker container stop
This is the command you use if you want to actually stop a @Docker container. This command will accept the container ID or the container name as it's argument.
4/ docker container ls
This will list all the @Docker containers in the running state.
Want to see all containers, even those that aren't running? Then add the -a flag to the command.
5/ docker container exec
This will run a new process inside of a running @Docker container.
It's especially useful for attaching the shell of your Docker host to a terminal inside of a running container.
For example, the following command will start a new bash shell inside of a running container and connect to it (assuming the image used to create the container includes the bash shell).
docker container exec -it <container-name or id> bash
6/ docker container start
If you want to start up a container that you previously stopped, then this is the command you want to run.
Just like the other commands we've seen, you can pass the name or ID of the @Docker container you want to start.
7/ docker container rm
This is how you delete a container.
Note that you can only delete a @Docker container if you've already stopped it.
8/ docker container inspect
This command will present all the detailed config and runtime info about your @Docker container.
Just like everything else we've seen, it accepts the container name or the container ID as arguments.
Here's a thread I did about the most useful commands for @Docker images. Be sure to bookmark it to read later, or retweet it for your network:
I write all sorts of life, career, and tech advice.
Follow me if you're interested.
In the next few weeks I'll be writing more about @Docker, @kubernetesio, data-centric AI, and MLOps
If you found this helpful and want to share it with your network (you'll look smarter and sexier if you do), then scroll back to the top and hit retweet
This command downloads images. You can pull images from repositories inside of remote registries. By default, images are pulled from @Docker Hub.
This command will pull images tagged as `latest` by default.
2/ docker image ls
This command lists all of the images stored in your @Docker hosts local image cache. You can use the `--digest` option to get the SHA256 hash code of the image as well.
A hiring manager isnβt going to be able to open your head, peek inside your brain, and verify if you know how to do this thing or that, or how well you understand this, that or the other.
Thatβs why you need to do a project.
2/ You need experience to get a job
But that doesnβt mean you need a job to get experience.
Data is everywhere.
You donβt need to be in a job at a company to get access to data.
If you know where to look and how to search for it, youβll quickly see that it is everywhere.