Using an Official Image for Deployment
The official Docker image site https://hub.docker.com/ provides TomEE images. The latest image tags that support the Kunpeng (ARM64v8) architecture include tomee:8-jre-8.0.0-M2-plus and tomee:8-jre-8.0.0-M2-plume. This section uses the tomee:8-jre-8.0.0-M2-plus tag as an example.
- Install the image.
1docker pull tomee:8-jre-8.0.0-M2-plus
- View the information about the local image that has been obtained.
1docker imagesREPOSITORY TAG IMAGE ID CREATED SIZE tomee 8-jre-8.0.0-M2-plus ff0e68ebc739 13 months ago 475MB
- If the environment can access the Internet only through a proxy, configure environment variables for the proxy server and configure Docker.
- Create a directory.
mkdir /etc/systemd/system/docker.service.d/
- Open the /etc/systemd/system/docker.service.d/http-proxy.conf file.
vim /etc/systemd/system/docker.service.d/http-proxy.conf
- Add the following content to the file. Save the file and exit.
[Service] Environment="http_proxy=http://youraccount:password@IP:PORT" Environment="https_proxy=https://youraccount:password@IP:PORT" Environment="NO_PROXY=localhost,127.0.0.1,docker-registry.example.com,.corp"
In the preceding content, youraccount indicates a user name, password indicates a password, IP indicates a proxy IP address, and PORT indicates a proxy port.
- Restart the related services for the settings to take effect.
1systemctl daemon-reload1systemctl restart docker
If the error message "Get https://registry-1.docker.io/v2/: proxyconnect tcp: net/http: TLS handshake timeout" is still displayed after the proxy is configured, retain only the HTTP proxy during proxy configuration.
- Create a directory.
- If the onsite environment cannot access the Internet, use a PC that can access the Internet to download the image and deploy the image to the target server.
- If the environment can access the Internet only through a proxy, configure environment variables for the proxy server and configure Docker.
- Create a container instance.
- Use the tomee:8-jre-8.0.0-M2-plus image to instantiate a container named mytomee. In the container, TomEE runs on port 8080.
1docker create -it -p 8888:8080 --name mytomee tomee:8-jre-8.0.0-M2-plus

-p 8888:8080 indicates that port 8080 inside a container is mapped to port 8888 outside the container so that external devices can access the TomEE service in the container through port 8888.
- View information about all created containers.
1docker ps -a

- Use the tomee:8-jre-8.0.0-M2-plus image to instantiate a container named mytomee. In the container, TomEE runs on port 8080.
- Run the created container instance.
- The container created using the docker create command does not automatically run after being created. You need to run the docker start container name command to run the container.
1docker start mytomee
- View the running container.
1docker ps
- After a container is created, run the container instance immediately.
1docker run -itd -p 8888:8080 --name mytomee tomee:8-jre-8.0.0-M2-plus
- When the container is running, you can run the docker stop container name command to stop the container.
1docker stop mytomee
- The container created using the docker create command does not automatically run after being created. You need to run the docker start container name command to run the container.
- Verify the running of TomEE.
When the mytomee container is running, use a browser on another PC in the same network segment as the server to access the Docker host machine through port 8888.
Enter http://host IP:8888 in the address box of the browser. If the home page of the TomEE service is displayed, the TomEE service is successfully deployed and running on the Docker.

- If port 8888 is occupied, you can use another port.
- In the official image, the installation directory of TomEE is /usr/local/tomee/. The configuration file is located in the /usr/local/tomee/conf/ directory, and the web application (WAR files) can be deployed in the /usr/local/tomee/webapps directory.