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
Preface The mv command is the abbreviation of mov...
mysql returns Boolean type In the first case, ret...
When it comes to <fieldset> and <legend&...
1. Introduction MySQL locks can be divided into g...
W3C, an organization founded in 1994, aims to unl...
Prerequisites Need to install git Installation St...
What is MyCAT A completely open source large data...
This article shares the vue card-style click-to-s...
The system environment is server2012 1. Download ...
Table of contents Project Introduction: Project D...
For work needs, I need to make a mobile phone adap...
I have roughly listed some values to stimulate ...
I am using the Ubuntu 16.04 system here. Installa...
Tomcat's default log uses java.util.logging, ...
Table of contents Merge namespaces with the same ...