A security alert appears when you build a Docker image on a non-Windows Docker host in docker

Asked 2 years ago, Updated 2 years ago, 83 views

Using the Dockertoolbox, Introduction to Docker 5~Use Dockerfile~[For beginners]

In , I created and built dockerfile.

It seems that the blogger created a directory called docker in the mac version ~/Desktop and created dockerfile there.Since I use dockertoolbox in Windows, I tried to proceed with the default directory as much as possible, but when I tried mkdir docker under the default /c/Program Files/Docker Toolbox, I got a permission error.

So I was worried, but I created a docker directory under /c/Desktop, created a dockerfile, and when I did docker build, the following message came out:I understand that it seems to be a security issue, but is there no problem if I proceed as it is?Also, the default directory /c/Program Files/Docker Toolbox when you start Docker Quickstart Terminal is denied permission, and I'm wondering if I can change it badly.Should I be able to work under this directory?

You are building a Docker image from Windows again - Windows Docker host. All files and directors added to build context will have'-rwxr-xr-x'permissions.It is recommended to double check and reset permissions for sensitive files and directories.

windows docker

2022-09-30 21:45

1 Answers

First point

C:\Program Files\ and below are usually errors because they cannot be written without administrator privileges.
Changing access rights to Program Files is one way, but for safety reasons, it is recommended that you have a separate folder (with write permission).

Second point

The You are building a Docker image... warning message says, "The files created are created with uniform -rwxr-xr-x = Everyone is created with read permission, so please modify them as needed."

If you share a PC, put the Docker container-related files directly under drive C and others will be able to view them.
You don't have to worry about modifying your access rights properly or using your PC as a personal user.


2022-09-30 21:45

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.