Hitachi CE50-10 Instruction Manual page 184

Table of Contents

Advertisement

F. Option Functions for Application Programs
$ sudo systemctl start docker
(b) Stopping Docker
Run the following command to stop Docker.
$ sudo systemctl stop docker
(c) Starting Docker when the OS starts
Run the following command to start Docker when the OS starts.
$ sudo systemctl enable docker
(3) Loading image files on Docker
The following describes how to transfer an image file to Docker and load it as a Docker image. The following
example describes how a Docker image is loaded by using an image called Ubuntu 18.04.3 distributed by the Docker
official repository.
1. Transfer the image file from the development environment to the container directory in the operation environment.
2. Remotely or locally log in to the operation environment.
3. Move to the directory in which the image file is placed, and then run the following command.
The image file is loaded.
$ sudo docker load < ubuntu-18.04.3.tar
4. Run the following command to confirm that the image file has been successfully loaded as a Docker image.
$ sudo docker images
If loading has been performed normally, the following should be displayed.
REPOSITORY
ubuntu
This concludes the loading of Docker images to the operation environment.
(4) Confirming that the container has started
The following describes how to start a container from a Docker image and then terminate that container. The
following example describe how to start the container for the Docker image Ubuntu 18.04.3.
1. Run the following command to start the container.
$ sudo docker run --rm -it repository-name:tag-name bash
For repository-name:tag-name, enter the values acquired from the information displayed by running the docker
images command.
• repository-name: Character string displayed in the REPOSITORY column (example: ubuntu)
• tag-name: Character string displayed in the TAG column (example: 18.04)
For example, enter as follows:
$ sudo docker run --rm -it ubuntu:18.04 bash
When the container operates normally, the bash command is run on the container.
2. When you confirm the normal operation, terminate the container.
root@a647f8520afd:/$ exit
This concludes operation verification of the container.
168
TAG
IMAGE ID
18.04
a2a15febcdf3
CREATED
SIZE
5 days ago
64.2MB

Advertisement

Table of Contents
loading

Table of Contents