It's been about two years since I first used the Docker container: baby: I feel like I've seen various usage scenarios, and sometimes I'm worried that I'm using it incorrectly.
The purpose is to convey to those who have started using Docker containers, and there is also the expectation that new usage knowledge will be obtained, so we will expose the "Docker container usage scene".
(Application distributor side)
--Prepare a Dockerfile --Build the container image including the source code, executable file, and execution environment --Put the container image in the registry
(Application user side)
--Get the container image from the registry -(Or build a container image from Dockerfile) --Use container image
--Prepare an execution environment at the time of development when the deliverable is only source code (library etc.) --Distributors don't even have to put the container image in the registry -(Prepare a Dockerfile)
-"2. Execution environment distribution use during development" prepares the execution environment of the program, whereas this puts the development environment in a container. -It seems that you can deploy the development environment to codespaces on github ――I haven't touched it yet, and I'm waiting until codespaces becomes GA. -~ All development environment is in the container ~ VS Code Dev Container Guideboo
--Use the container as a disposable environment
--When checking ubuntu, use docker run -it --rm ubuntu: 18.04 bash
$ curl "<Source storage>" > hoge_command
$ chmod +x hoge_command
$ mv hoge_command /usr/local/bin/hoge_command
hoge_command is a shell script, and ʻexec docker run fuga_container` is in the script.
Example: https://github.com/COLORFULBOARD/bq_profile/blob/master/bq_profile
I feel that it is convenient when distributing CLI applications easily
You can use the Docker container for the purpose of using the CLI application (command) without installing it.
--Use git without installing git
- docker run --name repo alpine/git clone https://github.com/docker/getting-started.git
- docker cp repo:/git/getting-started/ .
--Origin: Docker Desktop for Mac Tutorial
that's all. Please let me know if there is any other information that it would be convenient to use it in this way.
Recommended Posts