[Docker] Start container, start bash in container, delete image

Introduction

I summarized the flow when I want to enter the container in the terminal and try the command again.

flow

docker build

docker build -t test .

docker build: Based on Dockerfile, start Docker container, configure, create Docker image at once

-t test: Give an arbitrary image name with the -t option

.: The period at the end is to specify the directory where the Dockerfile is located. The period indicates the current directory

docker run

docker run --rm -it test bash

--rm: Deleted after executing the container -it: Output the result to the console bash: Start bash

docker rmi

docker rmi test

Specify the image with and delete

Articles that I used as a reference

Docker-docs-ja

-Introduction to Docker that I can't hear anymore (3): Create a Docker image with the Dockerfile and docker build commands (1/2)

At the end.

Thank you for reading to the end: bow_tone1: I am learning React and Rails from an inexperienced state because I am changing jobs. As I continue to post, I think that the input for that will inevitably increase, leading to growth. I think there are many things that are wrong with the content of the post and that should be added, so I would appreciate it if you could point out. Thank you for reading this article. Thank you!

Recommended Posts

[Docker] Start container, start bash in container, delete image
Delete unused docker image
Install yarn in docker image
docker review image creation-container start
[Memo] Commands used when using Docker (stop container, delete, delete image)
[Linux] Start Apache container with Docker
Kind @ Mac in Docker and vctl container
Build Spring Boot + Docker image in Gradle
Directly operate mariadb running in Docker container
Japanese setting of mysql in Docker container
How to start a Docker container with a volume mounted in a batch file
How to check the logs in the Docker container
How to update pre-built files in docker container
Edit Docker Container in VSCode multi-stage SSH Vagrant
Small Docker container
Update container image with KUSANAGI Runs on Docker
Docker in LXD
Change the location folder of Docker image & container
Docker + Spring-boot start
How Docker works ~ Implement the container in 60 lines
Let's finally use Docker: Start, stop, delete development environment
Steps to push Docker image to GitHub Container Registry (ghcr.io)
Localhost3000 does not start up in Docker / Rails development.
Automatically start the container
docker error delete command
Docker container usage scene
Delete all Docker images
Copy and paste the file contents in Ubuntu's Docker container
Check all container image vulnerabilities in private registries with trivy
Host specification when laravel php artisan serve in docker container
Put Redmine docker container in Raspberry Pi 4 Model B 2GB
[Docker] Delete only the volume associated with a specific container
Check all container image licenses in private registry with tern