Skip to content

Instantly share code, notes, and snippets.

@JT501
Last active August 31, 2023 17:53
Show Gist options
  • Save JT501/440435e5c2d7f4dc2f37e1c789820a04 to your computer and use it in GitHub Desktop.
Save JT501/440435e5c2d7f4dc2f37e1c789820a04 to your computer and use it in GitHub Desktop.
Docker container: Permission denied to /tmp after server reboot

It looks like it is a bug of latest version Google COS Google, Container-Optimized OS, 105-17412.156.30 LTS, Kernel: COS-5.15.120 Kubernetes: 1.25.5 Docker: 23.0.3 Family: cos-105-lts.

VM using older version has no issues.


Workaround

  1. Create Dockerfile with command RUN chmod 777 /tmp
  2. Shut down all affected container by docker-compose down
  3. Remove all the unused images by docker image prune -a
  4. Clear all the cache bu docker system prune
  5. Turn on the containers by docker-compose up -d, it will rebuild all the needed image and set correct permission to /tmp.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment