Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

docker - Why I am getting Screen is terminating error in MacOS

When trying to enter into Docker VM in mac, I am getting screen is terminating error whereby I cannot go into Docker Desktop. In Mac, Docker host is not the mac as it runs as a VM. Any solutions?

r

Thank you for the help.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Workarounds

I think it's a bug since version 2.3.0.4 of Docker Desktop for Mac, as I have used screen successfully to access the Docker VM in the past on Mac without this issue. (edit: this issue appears to be still present at version 2.4.0.0)

There are some alternative methods to access the Docker VM. Here is one that worked for me:

workaround method 1

run this command to enter shell of the Docker VM:

docker run -it --privileged --pid=host debian nsenter -t 1 -m -u -n -i sh

Then you can do what you need to do at the usual location for Docker volumes:

/ # ls -lah /var/lib/docker/volumes/
total 72
drwx------   10 root     root        4.0K Aug 27 11:34 .
drwx--x--x   15 root     root        4.0K Oct 31 00:51 ..
drwxr-xr-x    3 root     root        4.0K Aug 26 10:44 14ce94e174839f1947efa6fcbf5ac1fb2ea3b0f0b3f25311fee333ee374576b6
drwxr-xr-x    3 root     root        4.0K Aug 25 12:34 34eb2bd80931ff954e1da80c5383beb4def61129d4005432b77080531cd10a5a
drwxr-xr-x    3 root     root        4.0K Aug 27 11:34 830de2ce31519c921b50c448964b54517ca4461d337b56a9fd6e5b354ace3247
drwxr-xr-x    3 root     root        4.0K Aug 25 12:34 data-layer_mongo_data
drwxr-xr-x    3 root     root        4.0K Aug 26 11:01 ebb440184703bfad17184bd5ff74b677b50d74b8f0fbdd116506a1fcacfb00cd
drwxr-xr-x    3 root     root        4.0K Aug 27 11:27 hawakening-services_back-end_log
drwxr-xr-x    3 root     root        4.0K Aug 27 11:27 hawakening-services_front-end_log
drwxr-xr-x    3 root     root        4.0K Aug 27 11:27 hawakening-services_mongo_data
-rw-------    1 root     root       64.0K Oct 31 00:51 metadata.db

workaround method 2

Here's another one that also worked for me.

Run this command to enter shell of the Docker VM:

docker run --rm -it --privileged --pid=host walkerlee/nsenter -t 1 -m -u -i -n sh

As before, here is where the Docker volumes' directories are:

/ # ls -lah /var/lib/docker/volumes/
total 72
drwx------   10 root     root        4.0K Aug 27 11:34 .
drwx--x--x   15 root     root        4.0K Oct 31 00:51 ..
drwxr-xr-x    3 root     root        4.0K Aug 26 10:44 14ce94e174839f1947efa6fcbf5ac1fb2ea3b0f0b3f25311fee333ee374576b6
drwxr-xr-x    3 root     root        4.0K Aug 25 12:34 34eb2bd80931ff954e1da80c5383beb4def61129d4005432b77080531cd10a5a
drwxr-xr-x    3 root     root        4.0K Aug 27 11:34 830de2ce31519c921b50c448964b54517ca4461d337b56a9fd6e5b354ace3247
drwxr-xr-x    3 root     root        4.0K Aug 25 12:34 data-layer_mongo_data
drwxr-xr-x    3 root     root        4.0K Aug 26 11:01 ebb440184703bfad17184bd5ff74b677b50d74b8f0fbdd116506a1fcacfb00cd
drwxr-xr-x    3 root     root        4.0K Aug 27 11:27 hawakening-services_back-end_log
drwxr-xr-x    3 root     root        4.0K Aug 27 11:27 hawakening-services_front-end_log
drwxr-xr-x    3 root     root        4.0K Aug 27 11:27 hawakening-services_mongo_data
-rw-------    1 root     root       64.0K Oct 31 00:51 metadata.db

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...