Skip to content
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

Docker clock out-of-sync disallows package update and upgrade #19

Open
luksgrin opened this issue Aug 5, 2023 · 1 comment
Open

Docker clock out-of-sync disallows package update and upgrade #19

luksgrin opened this issue Aug 5, 2023 · 1 comment
Labels
bug Something isn't working Low priority WSL

Comments

@luksgrin
Copy link
Collaborator

luksgrin commented Aug 5, 2023

So I wanted to install some stuff through apt-get and it crashed. It was a dependency issue. Thus, I executed

sudo apt-get update

And it crashed. Seemingly, the internal clock was out of sync.

Attemtped to use the fix propted in the readme (but for the docker image):

sudo date -s "$(curl -s --head http://google.com | grep ^Date: | sed 's/Date: //g')"

Permission denied...
After doing some research, my fix was

1. Stopping the docker container

docker stop devops199

2. Stashing a copy somewhere else

docker commit devops199 my_temporary_image

3. Making sure my local machine's clock was set properly

Because the docker image inherits the time from the machine

4. Deleting the old image

docker rm devops199

5. Re-running the image

docker run -it -d --name devops199 -e TZ=MyTimeZone my_temporary_image

Replace MyTimeZone by the appropriate one (i.e. America/New_York, Europe/Madrid ...).

The bad thing about this fix is that now I have some space occupied by my_temporary_image:

docker image list

yields

REPOSITORY                         TAG       IMAGE ID       CREATED         SIZE
my_temporary_image                 latest    3a9438defdaf   2 hours ago     5.7GB
whitehat-machine                   latest    82d98c925275   2 months ago    2.65GB
@luksgrin luksgrin added the bug Something isn't working label Aug 5, 2023
@Deivitto
Copy link
Owner

Deivitto commented Aug 7, 2023

As far as I know these bug look related to the fact of the architecture your are using:
windows -> wsl2 ubuntu -> docker ubuntu

Would be interesting to test the same architecture in another computer. Will set as low priority meanwhile, as your workaround works and probably most users just run windows / mac / linux distro -> docker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Low priority WSL
Projects
None yet
Development

No branches or pull requests

2 participants