Docker container usage scene

Introduction: whale:

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".

1. Application distribution usage including source code and execution environment

(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

2. Execution environment distribution during development

--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)

3. DevContainer (development environment) distribution use, remote development environment use

-"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

4. Any sandbox application

--Use the container as a disposable environment --When checking ubuntu, use docker run -it --rm ubuntu: 18.04 bash

5. Use of "CLI application content is Docker container"

$ 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

6. Use for "temporary use of CLI application"

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

Docker container usage scene
Athrill's Docker container minimization procedure
Introduction to Linux Container / Docker (Part 1)
Laravel + Docker Laradock usage environment construction
Run React on a Docker container
Run GUI application on Docker container
Introduction to Linux Container / Docker (Part 2)
Run PureScript on a Docker container
Pass environment variables to docker container
[Docker] Operation up to container creation # 2
docker single container restart for myself
[Linux] Start Apache container with Docker
docker
Build WebRTC Janus with Docker container
About Docker, disguise server and container
Docker push to GitHub Container Registry (ghcr.io)
Kind @ Mac in Docker and vctl container
Launch docker container on EC2 (personal memorandum)
Run NordVPN on Docker (Windows) Ubuntu container
The story of updating SonarQube's Docker Container
Azure Container Instances! Lightweight and explosive container usage!
MySQL container does not start in Docker
Directly operate mariadb running in Docker container
[Docker] Copy files from docker container to host
[Docker] Start the container as soon as possible
[Docker] Start container, start bash in container, delete image
Docker container build fails to install php-radis
Introduction to Docker / Kubernetes Practical Container Development
Japanese setting of mysql in Docker container