简而言之:我正在尝试在Docker中安装主机目录,但是我无法从容器内访问它,即使访问权限看起来很好.
细节:
我在做
sudo docker run -i -v /data1/Downloads:/Downloads ubuntu bash
Run Code Online (Sandbox Code Playgroud)
然后
ls -al
Run Code Online (Sandbox Code Playgroud)
它给了我:
total 8892
drwxr-xr-x. 23 root root 4096 Jun 18 14:34 .
drwxr-xr-x. 23 root root 4096 Jun 18 14:34 ..
-rwxr-xr-x. 1 root root 0 Jun 18 14:34 .dockerenv
-rwx------. 1 root root 9014486 Jun 17 22:09 .dockerinit
drwxrwxr-x. 18 1000 1000 12288 Jun 16 11:40 Downloads
drwxr-xr-x. 2 root root 4096 Jan 29 18:10 bin
drwxr-xr-x. 2 root root 4096 Apr 19 2012 boot …Run Code Online (Sandbox Code Playgroud) 运行yarn docker-build工作正常,但何时yarn docker-up或yarn docker-dev在RUN yarn调用时弹出错误。Nginx 启动正常,但 yarn 无法进入 Projects 目录中的 mkdir。
包.json
...
"docker-build": "docker-compose build",
"docker-dev": "cross-env NGINX_HOST=localhost NGINX_PORT=3000 PORT=3000 docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --no-deps",
"docker-up": "cross-env NGINX_HOST=localhost NGINX_PORT=80 PORT=8080 docker-compose -f docker-compose.yml -f docker-compose.prod.yml up --no-deps -d",
"docker-down": "docker-compose down"
...
Run Code Online (Sandbox Code Playgroud)
文件
FROM mhart/alpine-node:8
# Install required dependencies (Alpine Linux packages)
RUN apk update && \
apk add --no-cache \
sudo \
g++ \
gcc \
git \ …Run Code Online (Sandbox Code Playgroud)