This article is aimed at readers who have some basic concepts about Docker technology, but have no hands-on experience because there is no test environment.
Recently Jerry had to set up various development environments for a new SAP cloud product development, one of which was Docker.
Jerry gave a brief introduction to Docker in a previous post:
- [Newton on the shoulders of giants: Kubernetes and SSAP Kyma]
- Running SAP UI5 applications on Kubernetes
- Running SAP UI5 applications on Kubernetes
The example given at the time was running a UI5 application with Docker and Kubernetes under the Ubuntu operating system. Because I know that many ABAP practitioners still use the Windows development environment, so this article simply listed the steps I set up Docker under the Windows operating system, interested friends can do it again.
By Windows, I mean Windows10.
To use Docker for Windows, you need to enable Hyper V virtualisation. Check the box in front of Hyper V in the Control Panel and restart.
Download the Community version of Docker For Windows:
The download is a 900 + Megabyte executable:
After installation, you can see the Docker icon in the lower right taskbar:
By default, the Docker command-line tool docker.exe and the container composing tool docker-compose.exe are installed in the Docker folder of the Program Files:
Right-click can be managed using a GUI way:
However, we are generally more accustomed to using the command-line tool docker.exe to operate on various container images.
Jerry has developed a SAP UI5 application in advance, deployed it and run it on the NGINX server, packaged it with the NGINX server in a container image, and published it on the Docker Hub at the following address:
Run the image directly from the command line:
Docker run i042416 / ui5 – nginx: v2.0
As you can see from the command print log, since my local environment does not have the image named I042416 / UI5-nginx labeled v2.0, the image will be automatically downloaded locally from the Docker Hub first.
Then use the docker images command to see that the image has been successfully downloaded to the local image, which is about 109MB in size:
Now start a container using the following command line:
Docker run -d-p 1080:80 –name jerrynginx i042416/ui5-nginx:v2.0
The meanings of each parameter are as follows:
-p: Map port 80 open to Nginx inside the container to port 1080 on the host, so that the host can access the container by entering localhost:1080 in a browser on Windows.
–name: Give the started container instance a name. After executing the command line, the browser enters the following URL to access the SAP UI5 application running on top of Nginx in the container:
The docker ps command shows the running instance of the container:
Docker inspect jerrynginx to inspect:
In the Dashboard menu of Windows Docker Desktop, you can see the instance of the container named JerryNginx running in the background:
The Dashboard provides some basic actions for runtime container instances, such as viewing logs:
As well as logging into container instances to interactively execute command-line functions. These functions should be implemented with the Docker command-line tool and can be used according to your preferences.
For more of Jerry’s original articles, please follow the official account “Wang Zixi “: