Skip to content
WGrape edited this page Mar 21, 2023 · 30 revisions

1. About Docker Desktop for Mac

(1) exit code 152

image
rm -rf ~/Library/Containers/com.docker.*

vi ~/Library/Group\ Containers/group.com.docker/settings.json

you just find "filesharingDirectories" and replace it "filesharingDirectories": [].

(2) mounts denied

image

You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing, as follows.

image

(3) ports are not available

Problem : docker: Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:8000 -> 0.0.0.0:0: listen tcp 0.0.0.0:8000: bind: address already in use.

Firstly, you should check the port with lsof -i:port command, and use command kill -9(Note: must add -9 option) kill this process.

image

If no service using the target port on your machine, you can try to restart docker or system.

(4) how to enter docker

docker exec -it ngxwayContainer bsah

(5) failed to mapping port

If you can't mapping port successfully, it may be caused by the incorrect order of the port mapping.

# correct
docker run --name testContainer -p outsidePort:insidePort -d testImage

# wrong
docker run --name testContainer -p insidePort:outsidePort-d testImage

# example
docker run --name nginxContainer -p 8010:80 -d nginx

(6) nanoCPUs can not be set

Problem :docker: Error response from daemon: NanoCPUs can not be set, as your kernel does not support CPU CFS scheduler or the cgroup is not mounted

You can remove --cpus=$maxNCPU option in the ngxway file. More detail

(7) docker couldn't stop

If you couldn't stop the docker desktop by operating in UI, please try to use kill -9 command or restart your mac.

2. About ApacheBenchmark Tool

What is ab ? It's be used for benchmarking server or something.

(1) how to install ab

  • For Mac
brew install httpd
  • For CentOS
yum install -y httpd-tools
  • For Ubuntu/Debian
sudo apt-get update
sudo apt-get install apache2-utils

3. About Start errors

(1) volume mount error

If you encounter this error, please have a try docker: Error response from daemon: Mounts denied, if it not work, you can change file sharing as follows.

image

If you still have problems, it may be due to permission error, try changing to the correct permission group or using another directory.

(2) load metadata error

image

You just run rm ~/.docker/config.json and try again.

4、About Yum

(1) bad request

If you encounter this error, you can try to disable the proxy you are using.

image

If you still have problems, you can try it : https://access.redhat.com/solutions/200153

5、About Openresty

(1) repository does not exist

Problem : docker: Error response from daemon: pull access denied for openresty, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.

You shouldn't use command docker run ... -d openresty, you should use complete openresty/openresty

# correct
docker run --name openrestyContainer -p 8011:80 -d openresty/openresty

# wrong
docker run --name openrestyContainer -p 8011:80 -d openresty