Install Docker and create Java runtime environment
A memorandum that I thought I would try with Docker when building a Java execution environment on a new personal computer
- Download Docker Toolbox [link] with VirtualBox and Kitematic.
- The Setup screen is OK with the default settings, confirm on the last screen and click [Install]
- When you start the shortcut of Docker Quickstart Terminal created on the desktop (such as > </ font> & # x1f40b;), various displays will be displayed, so wait.
- Complete when a whale picture appears like the image <img width = "656" alt = "2020-06-27 (1) .png " src = "https://qiita-image-store.s3.ap" -northeast-1.amazonaws.com/0/400039/20121d56-d7de-f30d-a410-875c38ebafb6.png ">
docker run hello-world in the Docker terminal and press Enter to download the Docker image named" hello-world "<img width =" 656 "alt =" 2020-06-27 " (2) .png "src =" https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/400039/e1426465-5ef1-bb8e-577c-54dc8936727e.png ">
Download Docker image
You can enter commands in the terminal as it is, but this time I will download the Docker image using Kitematic which is easy to understand visually
- Launch Kitematic from a desktop shortcut
- Select [USE VIRTUALBOX] on the "Setup Initialization" screen, and you don't have to create a DockerHub account.
- Enter a keyword in the search box on the screen that appears after setup is complete (java this time)
- Select "openjdk" from the candidates that came out, and press the [CREATE] </ font> button <img width = "810" alt = "2020-06-27 (4) ) .png "src =" https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/400039/db9dd75e-755e-e8e2-d497-14a4d1052e92.png ">
- When "openjdk" is displayed in the Containers column on the left side and a gray icon is displayed like "hello-world" (downloaded from the terminal earlier), the download is complete.
** If "Connecting to Docker Hub" is displayed and the download does not proceed ** summary>
--Click DOCKER CLI </ font> at the bottom left of the image above to launch PowerShell.
docker pull scraping hub / splash and Enter
--After waiting for a while, various downloads have been completed, so when you return to Kitematic in this state, the downloads have been completed.
--If it doesn't work, stop downloading the Docker image and try downloading again by pressing the [CREATE] </ font> button </ div> </ details>
Create a container from a Docker image
When I tried to do this with Kitematic, no matter how many times I clicked [START], it stopped immediately, so I went back to the Docker terminal and worked on it.
docker run -it --name testcont openjdk: latest to create the container in the running state ("testcont" is the name of the container)