-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Time sync differences between docker containers for Windows and the hosting machine #3168
Comments
Install ntp on the container? |
I am having this issue as well, using aspnet:latest |
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
/remove-lifecyclestale |
Has anyone come up with any solution to this problem? I ran into the same issue right now when trying to access CosmosDb container from a container using mcr.microsoft.com/dotnet/core/aspnet:2.2-nanoserver-1803 as base. Time difference is 8 hours for me also. When accessing the CosmosDb container from the host then I had no issues. |
Probably will need to install ntp so you're not relying on the docker clock |
I managed to solve it in the end by upgrading to the latest Windows 10 version (10.0.18362) and was then also able to upgrade my container to use mcr.microsoft.com/dotnet/core/aspnet:2.2-nanoserver-1903 (compared to 1803 before). No more time problems causing certificate issues :-) |
As another datapoint, Im getting some ~similar behaviour: edit: added windows context:
ethan@host:~$ echo "container: $(sudo docker run alpine date)" && echo "host: $(TZ="UTC" date)"
container: Wed Jan 15 03:41:01 UTC 2020
host: Wed Jan 15 20:06:12 UTC 2020
ethan@host:~$ sudo docker version
Client:
Version: 18.09.7
API version: 1.39
Go version: go1.10.1
Git commit: 2d0083d
Built: Fri Aug 16 14:20:06 2019
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.5
API version: 1.40 (minimum version 1.12)
Go version: go1.12.12
Git commit: 633a0ea
Built: Wed Nov 13 07:29:19 2019
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.2.10
GitCommit: b34a5c8af56e510852c35414db4c1f4fa6172339
runc:
Version: 1.0.0-rc8+dev
GitCommit: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
docker-init:
Version: 0.18.0
GitCommit: fec3683 |
/remove-lifecycle stale |
What I've done is simply restart the Docker environment and the sync was correctly done in the container. |
I'm also seeing this behaviour after upgrading to Docker Desktop 2.2. |
the restart is simple, knowing to expect telemetry submissions (etc, insert artibrary timesensitive processing here) arriving ~half a day off is the less simple/obvious complication here... 😅 |
Possibly the same as #4526 (I experienced it as API auth problems too!) |
My computer datetime is "02/14/2020 02:50 PM". if run tag ":1803" image will get incorrect datetime.
If run tag ":1909" datetime is correct.
docker version
win ver:
|
Having the same issue with mcr.microsoft.com/dotnet/framework/aspnet:4.7.2 on Windows 10 (1903), containers consistently created with OS time two or more hours ahead of host. Restarting services/host provides no relief. I believe this was introduced with the docker desktop update as my image has changed only superficially in the last few months and this issue presentation appears to have surfaced after the docker desktop update. I did experience this issue around a year ago, and a Docker Desktop update apparently resolved it. |
In release note: |
This is the same as #4526, and there's more discussion there, so I'm going to close this copy. There is a new build at #4526 (comment) that you can try. |
Closed issues are locked after 30 days of inactivity. If you have found a problem that seems similar to this, please open a new issue. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
DiagnosticsID: 1F3FB75F-3F5E-4EE0-8D08-4F7C2E233988/20190102225357
The following issue looks like this one:
#409
but there it is written/confirmed that it is fixed with the new (back then, 2017) version, while I am having the problem now, with the latest versions.
I started having an error when try to access CosmosDB from an api, contained in a Docker container hosted on my windows 10 (used to work before):
I see a few hours time difference between the docker container and my windows 10 laptop.
Here is my "anonymized" docker file:
`FROM microsoft/dotnet:2.2-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE 80
FROM microsoft/dotnet:2.2-sdk AS build
WORKDIR /src
COPY Services//.API.csproj Services/.API/
COPY Services/****.csproj Services//
RUN dotnet restore Services/.API.csproj
COPY . .
WORKDIR /src/Services/********
RUN dotnet build *****.csproj -c Release -o /app
FROM build AS publish
RUN dotnet publish .API.csproj -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", ".API.dll"]
`
Started having this with image for 2.1 dotnet core. Since then:
Without any success - still getting the same error.
Any ideas?
(The solution contains 4 containers in total, all of them are with the same time, but it is different from the host machine (my windows laptop. Same solution was working about 1 month ago - before Docker and Windows upgraded)
Update
If I do:
docker exec -it de7 cmd
and then:
C:\app> Time
I am getting:
The current time is: 3:15:18.44
which is 8 hours different than my hosting machine's current time.
But if I make a new file in the container:
C:\app> echo abc > MyFile.txt
I am getting the correct creation time:
01/02/2019 11:12 PM myfile.txt
The text was updated successfully, but these errors were encountered: