How to check if the Docker container time zone is consistent with the host machine? 1. Enter the host machine and execute the following command:
2. Enter the container and execute the following command
CST should refer to (China Shanghai Time, Eastern Time Zone 8) UTC should refer to (Coordinated Universal Time, standard time) It can be found that they are 8 hours apart, and the time zone of the host machine and the Docker container are inconsistent. Solution: 1. [Before the image is produced] The base image sets the time zone in the Dockerfile:
2. [After the image is generated && the container is not created] When creating and starting the container:
3. [After the image is generated && the container is started] Outside the container, modify in the host machine:
4. [After the image is generated && the container is started] In the container
Additional knowledge: Docker command error error during connect: Get http://2F2F.2Fpipe2Fdocker_engine/v1.36/containers/json: open//. Executing docker ps reports an error
The error message is as follows: Workaround 1. Execute the command:
2. Method 1: Copy the displayed command and execute it After execution, execute commands such as docker ps and you can use it normally 3. Method 2: Only the last sentence
Remove REM from the command and execute it.
After execution, the docker command can be used normally. Each time you open a new cmd window, you need to set the environment variables first. Note: When using method 2 in a bat script, directly putting the FOR statement into the bat script will result in an error. Change the %i in the command to %%i. The above Docker container time zone adjustment operation is all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. You may also be interested in:
|
<<: How to make if judgment in js as smooth as silk
>>: MySQL obtains the current date and time function example detailed explanation
Table of contents 1. Example 2. Create 100 soldie...
Table of contents background How to determine whe...
Relationship between MySQL and MariaDB MariaDB da...
When using Dreamweaver or FrontPage to create HTM...
There are already many articles about slot-scope ...
The MERGE storage engine treats a group of MyISAM...
1. Introduction Docker has an orchestration tool ...
Table of contents What does the COUNT function do...
Download MySQL https://dev.mysql.com/downloads/my...
I am planning to organize the company's inter...
This article uses examples to illustrate the erro...
Table of contents 1. Database Engine 1.1 View dat...
When the software package does not exist, it may ...
Postfix is a free and open source MTA (Mail Tra...
Table of contents 1. Prepare data Create a data t...