I have created a docker-compose.yml using cloudestuary. After downloading it and putting it in my Laravel project folder and running docker-compose up -d the download takes place and then I get this message:
ERROR: for worker-1 Cannot start service worker-1: error while creating mount source path ‘/var/www/html/lensin/html’: mkdir /var/www: read-only file system
ERROR: for nginx Cannot start service nginx: error while creating mount source path ‘/var/www/html/lensin/html’: mkdir /var/www: read-only file system
ERROR: for app Cannot start service app: error while creating mount source path ‘/var/www/html/lensin/html’: mkdir /var/www: read-only file system
ERROR: for workspace Cannot start service workspace: error while creating mount source path ‘/var/www/html/lensin/html’: mkdir /var/www: read-only file system
ERROR: Encountered errors while bringing up the project.
I`m on Ubuntu 17, and have tried even to set 777 to all folders, and running it with sudo, but the result is the same. I have also tried to move the file and to edit the volumes in yml.
Here is my docker compose file:
version: '2'
services:
nginx:
image: 'cloudestuary/nginx:mainline-fpm'
restart: always
environment:
CLIENT_MAX_BODY_SIZE: 100m
DOCUMENT_ROOT: /var/www/html/public
INDEX_FILE: index.php
PHP_FPM: app
networks:
- app
volumes:
- './html:/var/www/html'
ports:
- '80:80'
app:
image: 'cloudestuary/php-fpm:7.1'
restart: always
environment:
MAX_UPLOAD_FILE_SIZE: 100m
APP_URL: 'http://lensin.localhost'
APP_KEY: 'base64:2X9U1HiBdmfbwvZ4UkwUP/25svg7439HXKWL1F8Xn1c='
DB_CONNECTION: mysql
DB_HOST: mysql
DB_PORT: '3306'
DB_DATABASE: cloudestuary
DB_USER: cloudestuary
DB_PASSWORD: secret
networks:
- app
volumes:
- './html:/var/www/html'
workspace:
image: 'cloudestuary/php-workspace:7.1'
restart: always
ports:
- '2222:22'
environment:
MAX_UPLOAD_FILE_SIZE: 100m
APP_URL: 'http://lensin.localhost'
APP_KEY: 'base64:2X9U1HiBdmfbwvZ4UkwUP/25svg7439HXKWL1F8Xn1c='
DB_CONNECTION: mysql
DB_HOST: mysql
DB_PORT: '3306'
DB_DATABASE: cloudestuary
DB_USER: cloudestuary
DB_PASSWORD: secret
SSH_PASSWORD: xsKEVWXPrdAeg
networks:
- app
volumes:
- './html:/var/www/html'
worker-1:
image: 'cloudestuary/php-cli:7.1'
restart: always
networks:
- app
environment: { }
volumes:
- './html:/var/www/html'
command: 'php artisan queue:work'
mysql:
image: 'mysql:5.7'
restart: always
networks:
- app
environment:
MYSQL_ROOT_PASSWORD: toor
MYSQL_PASSWORD: secret
MYSQL_USER: cloudestuary
MYSQL_DATABASE: cloudestuary
volumes:
- 'mysql-data:/var/lib/mysql'
volumes:
mysql-data: { }
networks:
app: { }
h3xStream
6,1332 gold badges45 silver badges57 bronze badges
asked Aug 18, 2017 at 20:17
4
It’s likely a pathing issue with Docker when installed with snap
, you’re better off installing it with the official documentation from Docker.
Remove docker from snap
snap remove docker
Remove the docker directory, and old version (It’s okay if these don’t exist already)
rm -R /var/lib/docker
sudo apt-get remove docker docker-engine docker.io
Install the official docker package: https://docs.docker.com/install/linux/docker-ce/ubuntu/
Update: Since posting this answer, I’ve learnt that tools installed using snap
are installed in a sandbox with limited permissions outside of that sandbox. This is likely the cause as docker
won’t have access to the external filesystem from its isolated sandbox environment.
answered Feb 2, 2019 at 11:18
6
Restart your docker service. Then the problem will solve.
sudo systemctl restart docker
answered Aug 5, 2020 at 22:49
3
What led me here was the Kubernetes V1VolumeMount. When deploying my application I was getting the same error format:
ERROR: for <pod_name> Cannot start <service_name>: error while creating mount source path '<source_path>': mkdir <dir_path>: read-only file system
At the start I was thinking permissions error as well, hence the message is a bit misleading. I turned out that I was trying to mount something that didn’t exist in the source image. Hence, my uneducated suggestion would be, verify that what you are trying to mount does exist, if it doesn’t you probably don’t need that mount path.
P.S. I saw that there wasn’t an accepted answer, so I am hoping that my contribution is not causing unnecessary cluttering.
answered Jan 22, 2020 at 9:59
1
Got this error but the issue was that the source path was a symlink. For some reason docker does not seem to like it, even after restarting the service.
Had to use a real path and then it worked just fine with Docker version 20.10.8
installed with snap
.
answered Nov 9, 2021 at 16:39
NagevNagev
9,3354 gold badges52 silver badges66 bronze badges
For Docker on Windows 10, sometimes you have just to wait a while (1-5 min) before executing docker-compose up
again.
Hope this will help someone else.
answered Dec 31, 2019 at 8:29
1
Description
Cannot mount volumes located on different mount points than /home
I can mount volumes in the /home path:
docker run -i -t -v /home/bigdata/tmp/:/test ubuntu
but not volumes outside this path:
docker run -i -t -v /mnt/bigdata/tmp/:/test ubuntu
The mount options are identical for both paths:
results of: mount | grep sdb3
/dev/sdb3 on /home/bigdata type ext4 (rw,relatime,data=ordered)
/dev/sdb3 on /mnt/bigdata type ext4 (rw,relatime,data=ordered)
Steps to reproduce the issue:
- Run docker container with a volume on a path outside /home, e.g.
docker run -i -t -v /mnt/bigdata/tmp/:/test ubuntu
- The following error is produced:
docker: Error response from daemon: error while creating mount source path '/mnt/bigdata/tmp': mkdir /mnt/bigdata: read-only file system.
- The same error occurs when a volume is created with the
docker volume create
command.
Describe the results you received:
docker: Error response from daemon: error while creating mount source path '/mnt/bigdata/tmp': mkdir /mnt/bigdata: read-only file system.
Describe the results you expected:
Creating a container with mounted volume on a path outside the /home path.
Additional information you deem important (e.g. issue happens only occasionally):
It happens all the time. Even with apparmor disabled with the following options: --security-opt apparmor=unconfined
and --privileged
.
Output of docker version
:
Client:
Version: 17.06.0-ce
API version: 1.30
Go version: go1.8.3
Git commit: 02c1d87
Built: Fri Jun 23 21:23:31 2017
OS/Arch: linux/amd64
Server:
Version: 17.06.0-ce
API version: 1.30 (minimum version 1.12)
Go version: go1.8.3
Git commit: -snap-6d8af6a
Built: Thu Jun 29 22:50:34 2017
OS/Arch: linux/amd64
Experimental: false
Output of docker info
:
Containers: 1
Running: 0
Paused: 0
Stopped: 1
Images: 17
Server Version: 17.06.0-ce
Storage Driver: aufs
Root Dir: /var/snap/docker/common/var-lib-docker/aufs
Backing Filesystem: extfs
Dirs: 13
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: (expected: cfb82a876ecc11b5ca0977d1733adbe58599088a)
runc version: N/A (expected: 2d41c047c83e09a6d61d464906feb2a2f3c52aa4)
init version: 949e6fa
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.10.0-30-generic
Operating System: Ubuntu Core 16
OSType: linux
Architecture: x86_64
CPUs: 12
Total Memory: 62.84GiB
Name: Skola
ID: MZKU:NTSS:P3VX:YL6C:WOQH:PAXY:ZTTM:I7UV:TGEB:O7C6:P5KP:UKFM
Docker Root Dir: /var/snap/docker/common/var-lib-docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: 16
Goroutines: 25
System Time: 2017-08-07T18:30:35.112381853+02:00
EventsListeners: 0
Username: konopik
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
WARNING: No swap limit support
Additional environment details (AWS, VirtualBox, physical, etc.):
A physical machine running:
Distributor ID: Ubuntu
Description: Ubuntu 17.04
Release: 17.04
Codename: zesty
Содержание
- Error response from daemon: error while creating mount source path, mkdir /run/desktop/mnt/host/c/Users/. file exists #12403
- Comments
- Actual behavior
- Expected behavior
- Information
- Steps to reproduce the behavior
- Error in creating mount source path with docker #48
- Comments
- Footer
- Docker run fails with «read-only file system» #749
- Comments
- Error when mounting host path with Docker for Windows — «Permission Denied» #3385
- Comments
- Expected behavior
- Actual behavior
- Information
- Steps to reproduce the behavior
- error while creating mount source path ‘/var/lib/etcd’: mkdir /var/lib/etcd: permission denied #13900
- Comments
Error response from daemon: error while creating mount source path, mkdir /run/desktop/mnt/host/c/Users/. file exists #12403
- I have tried with the latest version of Docker Desktop
- I have tried disabling enabled experimental features
- I have uploaded Diagnostics
- Diagnostics ID:
Actual behavior
When I want to run the image with this command:
I get this error message:
Expected behavior
The container should be started and the mount point should appear in /var/www/ .
Information
- Windows Version: Microsoft Windows [Version 10.0.19043.1348]
- Docker Desktop Version: Docker Desktop 4.2.0 (70708)
- WSL2 or Hyper-V backend? WSL2
- Are you running inside a virtualized Windows e.g. on a cloud server or a VM: No.
Steps to reproduce the behavior
- I have two physical drives, C: and E:
- On E: , each user has their own working directories, like E: . This is because I don’t like spaces in the user name Windows creates for me.
- There is a file E: Projektek
src2my-file.html .
I created a junction in CMD.EXE, run as Administrator: mklink /J «c:Users src6» e: Projektek
src2 . Note: has no spaces in it, while is my first name and my last name, separated by a space.
stops with an error message:
Why is it an error that src6 exists? Of course, it does, I want to see its content under /var/www/.
This problem seems to be similar to #5516 but the solution written there does not solve the problem for me.
The text was updated successfully, but these errors were encountered:
Источник
Error in creating mount source path with docker #48
I was trying to use hap.py with Google DeepVariant, with the following command.
However, I get the following error
docker: Error response from daemon: error while creating mount source path ‘/homes/pyk12/Desktop/DeepVariant’: mkdir /homes: read-only file system.
I am not sure if I have installed docker or hap.py wrong, or have made other mistakes. I have tested docker with docker run hello-world and apparently it can run. Do you have any idea what the problem is?
I am using ubuntu 16.04 and I used docker pull pkrusche/hap.py to get the docker images. Following is the output of the docker info.
The text was updated successfully, but these errors were encountered:
Are you sure /homes is the correct path, not /home ?
Mounting things inside Docker requires access to all folders that you would like to mount. Depending on your system, setup and Docker version, slightly different commands might be required. Docker has some documentation on this here: https://docs.docker.com/storage/volumes/
Thank you for the reply. I am working on a shared server so the name is /homes .
When you say it requires access to folders I would like to mount, does it mean the /homes drive in this case? As far as I understand, the code above is mounting /homes/ on /data under docker image pkrusche/hap.py. Is that right?
As I am working on a shared server, I have tried running the code as root (have root access but not full access to /homes)and in my personal account (which without root access). In both cases, the error docker: Error response from daemon: error while creating mount source path ‘/homes/pyk12/Desktop/DeepVariant’: mkdir /homes: read-only file system. occurs. So I am not sure what may be the problem.
On the other hand, can I simply use hap.py instead of using it through docker? What would be the drawback if I do so?
Thank you very much for your help.
One possibility is that the /homes folder is mounted via NFS and this causes problems for Docker. It seems this has happened before: moby/moby#31792
A thing you could try is to copy your files into a locally mounted directory (e.g. /tmp) and mount that.
Compiling hap.py directly should work also (the Dockerfile gives all the required packages).
© 2023 GitHub, Inc.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Источник
Docker run fails with «read-only file system» #749
I’m on Ubuntu 18.10, and I’m trying to run a .NET Core project in VSCode with to Dockerfile being added by running the command `Docker: Add Docker Files to Workspace».
Here’s my configuration
And, a screenshot of my project structure:
And, my (auto-generated) Dockerfile:
But when I try to start the project, I see this error in my output window:
Am I missing something here?
It may be worth mentioning that on my machine, I can run docker commands without sudo
The text was updated successfully, but these errors were encountered:
@farzadmf What version of Docker is installed? Is it the «snap» ( docker-snap ) version or the «standard» ( docker-ce ) version?
@philliphoff I installed it using snap install docker ; this is the result of snap list :
@farzadmf From the error message, it may be related to the use of the snap version of Docker, which seems to have issues creating volumes that mount outside of the user’s home directory. (The Docker extension adds a volume during debugging that mounts to the NuGet package fallback folder on the local machine.)
I’m trying to setup a VM with that same configuration to confirm that; in the meantime, you may have more luck with the «standard» Docker installation.
Thank you @philliphoff for your answer, I did what you suggested, and actually, the «standard» Docker installation seems to have a more recent version.
BUT, now I have a very annoying problem that I don’t know how to solve; if you could somehow help me with this, I would really appreciate it.
So, I installed docker using apt , and I’m able to run containers (I had an error is VSCode, but it might be a side effect of this, so I’m trying in «normal» terminal), but when I want to stop the containers, I see this error:
Do you have any idea why that’s happening? I’d appreciate if you help me
Maybe related to this @farzadmf? The scenario sounds similar (switching from the Ubuntu packaged Docker to the «standard» one).
Also, is your VS Code installed via snap as well?
Thank you @philliphoff for the link. It might have been an issue with groups/users etc. I looked at «Linux post-installation steps» in Docker docs, tried a few commands, restarted a few times, and it seems to be working now.
As for VSCode, it WAS installed using snap , but because of some font issues, I removed it and installed it using the deb package.
And, now that those things are fixed, I tried again with VSCode to run docker, and I get this message:
And when I do docker ps , I see this container is running:
Источник
Error when mounting host path with Docker for Windows — «Permission Denied» #3385
Expected behavior
I’m not able to do a docker run … I get the error below. I’m trying to run a Linux container on Windows 10.
error while creating mount source path ‘/host_mnt/c/Users/xyz/AppData/Roaming/Microsoft/UserSecrets’: mkdir /host_mnt/c/Users/xyz/AppData: permission denied.
Actual behavior
Run the container successfully
Information
- Windows Version: Windows 10
- Docker for Windows Version: 2.0.0.0-win78 (28905)
I checked the Drive sharing config and Drive sharing is enabled with credentials that have local admin rights on my machine.
Steps to reproduce the behavior
The text was updated successfully, but these errors were encountered:
Same problem here.
Same here.
For context, I have an Azure Active Directory account and I had to create another local one with the same name to be able to use Docker AT ALL. But it seems to still be unable to mount folders inside the user directories.
Also have this problem. Creates volumes fine once you add the local account, the container just cant access them. Doesn’t seem matter what rights I put on the .docker folder either for the new account user.
Also see «Error response from daemon: error while creating mount source path ‘/host_mnt/c/Users//.docker/Volumes/elasticdata-elasticsearch-0/pvc-64d22745-7883-11e9-9d67-00155d021b09’: mkdir /host_mnt/c/Users//.docker: permission denied» when inspecting the pod. File exists in the user directory and no issue with volumes themselves it seems.
Tried unsuccessfully to find a way to change the directory for these volumes to somewhere I would have more control as having them on another drive would be useful also.
The solution seems to be to add the Users group to the .docker folder and grant full access. Just the new local account access wasn’t enough for me.
@DarrenV79 could you please explain in more details how to add Users group to .docker folder and grant full access? thanks in advance
@daton89 To add a group to a directory you in windows follow these steps:
- Right-click the dir
- Click properties
- click the security tab
- click the «Edit» button.
- click the add button
- Type «users» in the text box
- click «Check Names» (should auto fill/update for you)
- click okay
- Highlight your newly added group.
10 . Under «Permissions for [User/Groupname]» select Full control - click apply
- Click «OK»
- Click «OK»
With all that out of the way I will report that adding the «Users» group to just the .docker file in my c:Users[home].docker dir did not work.
What did work was having the Users group added to at least the .docker, the great great great grandparent dir of my working dir, and the local dir I was trying to mount to my container.
Same problem. Trying to give access to users.
@freerider7777 were you able to resolve your issue?
@alexkoepke Yes, I gave permissions from @DarrenV79’s workaround and it worked
What did work was having the Users group added to at least the .docker, the great great great grandparent dir of my working dir, and the local dir I was trying to mount to my container.
@alexkoepke this solved it for me as well
@DarrenV79 ‘s answer solved my issue as well.
Giving full permissions only to the .docker folder didn’t seem to work for me. Giving full permissions to the entire User folder seemed to do the trick, even though it is nasty.
My setup is as follows:
- I have a primary account called «User» onto which I’m currently logged in and do my development work
- I have a user called «DockerDiskSharing» with full admin rights, which I intend to use for Docker to run with
The steps I took were:
- I opened a command prompt with admin rights and added the DockerDiskSharing user to the docker-users group by running
net localgroups docker-users DockerDiskSharing /add
- I went to Docker -> Settings -> Shared Drives, I clicked «Reset credentials» and added the DockerDiskSharing user’s credentials. I ticked C drive (my main partition) and the D drive (where my project is located)
- I opened a command prompt with admin rights and gave full access permissions to the entire Users/User folder by running:
icacls «C:UsersUser» /q /c /t /grant docker-users:F
Still unsure which folders in particular it needs permissions to read/write to though from Users/User but it worked.
Источник
error while creating mount source path ‘/var/lib/etcd’: mkdir /var/lib/etcd: permission denied #13900
Rancher versions:
rancher/rancher: latest (2018-06-08: v2.0.2)
rancher/rancher-agent: v2.0.2
Infrastructure Stack versions:
healthcheck: ?
ipsec: ?
network-services: ?
scheduler: ?
kubernetes (if applicable): ?
Docker version: ( docker version , docker info preferred)
Machine 1: Debian Jessie, Docker 18.03.1-ce, hostname: banana , ip: 192.168.8.227 , purpose: rancher ui
Machine 2: Ubuntu bionic, Docker 17.06.2-c2, hostname: honeydew , ip: 192.168.8.220 purpose: rancher agent
Operating system and kernel: ( cat /etc/os-release , uname -r preferred)
Machine 1: Debian Jessie, Docker 18.03.1-ce, hostname: banana , ip: 192.168.8.227 purpose: rancher ui
Machine 2: Ubuntu bionic, Docker 17.06.2-c2, hostname: honeydew , ip: 192.168.8.220 purpose: rancher agent
Type/provider of hosts: (VirtualBox/Bare-metal/AWS/GCE/DO)
Setup details: (single node rancher vs. HA rancher, internal DB vs. external DB)
Single node rancher/rancher + Single node rancher/agent
Environment Template: (Cattle/Kubernetes/Swarm/Mesos)
?
Steps to Reproduce:
Machine 1: Debian Jessie, Docker 18.03.1-ce, hostname: banana , ip: 192.168.8.227 purpose: rancher ui
- run sudo docker run -d —restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher
- Add custom cluster, only give name according to Quick Start Guide
- Select all three node roles, copy comand
Machine 2: Ubuntu bionic, Docker 17.06.2-c2, hostname: honeydew , ip: 192.168.8.220 purpose: rancher agent
- run sudo docker run -d —privileged —restart=unless-stopped —net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.0.2 —server https://banana —token . omitted. —ca-checksum d177d1abd136f16ea83e89bede2dcc1b24416854c055e1ce7d2685eefa5fb8f5 —etcd —controlplane —worker
Results:
- While provisioning the first node on Machine 2(rancher agent), the rancher ui shows this:
— The error message in rancher ui in plain text
- The logs in honeydew for the first docker image show:
- The logs in honeydew for the second docker image show:
The text was updated successfully, but these errors were encountered:
Источник
Error response from daemon: error while creating mount source path, mkdir /run/desktop/mnt/host/c/Users/. file exists #12403
Comments
halmai commented Nov 28, 2021
- I have tried with the latest version of Docker Desktop
- I have tried disabling enabled experimental features
- I have uploaded Diagnostics
- Diagnostics ID:
Actual behavior
When I want to run the image with this command:
I get this error message:
Expected behavior
The container should be started and the mount point should appear in /var/www/ .
Information
- Windows Version: Microsoft Windows [Version 10.0.19043.1348]
- Docker Desktop Version: Docker Desktop 4.2.0 (70708)
- WSL2 or Hyper-V backend? WSL2
- Are you running inside a virtualized Windows e.g. on a cloud server or a VM: No.
Steps to reproduce the behavior
- I have two physical drives, C: and E:
- On E: , each user has their own working directories, like E: . This is because I don’t like spaces in the user name Windows creates for me.
- There is a file E: Projektek
src2my-file.html .
I created a junction in CMD.EXE, run as Administrator: mklink /J «c:Users src6» e: Projektek
src2 . Note: has no spaces in it, while is my first name and my last name, separated by a space.
stops with an error message:
Why is it an error that src6 exists? Of course, it does, I want to see its content under /var/www/.
This problem seems to be similar to #5516 but the solution written there does not solve the problem for me.
The text was updated successfully, but these errors were encountered:
Источник
Cannot mount volumes outside /home path — read-only file system #34427
Comments
konopik commented Aug 7, 2017
Description
Cannot mount volumes located on different mount points than /home
I can mount volumes in the /home path:
docker run -i -t -v /home/bigdata/tmp/:/test ubuntu
but not volumes outside this path:
docker run -i -t -v /mnt/bigdata/tmp/:/test ubuntu
The mount options are identical for both paths:
results of: mount | grep sdb3
/dev/sdb3 on /home/bigdata type ext4 (rw,relatime,data=ordered)
/dev/sdb3 on /mnt/bigdata type ext4 (rw,relatime,data=ordered)
Steps to reproduce the issue:
- Run docker container with a volume on a path outside /home, e.g. docker run -i -t -v /mnt/bigdata/tmp/:/test ubuntu
- The following error is produced: docker: Error response from daemon: error while creating mount source path ‘/mnt/bigdata/tmp’: mkdir /mnt/bigdata: read-only file system.
- The same error occurs when a volume is created with the docker volume create command.
Describe the results you received:
docker: Error response from daemon: error while creating mount source path ‘/mnt/bigdata/tmp’: mkdir /mnt/bigdata: read-only file system.
Describe the results you expected:
Creating a container with mounted volume on a path outside the /home path.
Additional information you deem important (e.g. issue happens only occasionally):
It happens all the time. Even with apparmor disabled with the following options: —security-opt apparmor=unconfined and —privileged .
Output of docker version :
Output of docker info :
Additional environment details (AWS, VirtualBox, physical, etc.):
A physical machine running:
The text was updated successfully, but these errors were encountered:
thaJeztah commented Aug 7, 2017
Did you install docker from the .deb packages? Is the daemon started using the standard systemd unit?
konopik commented Aug 8, 2017
Thanks. I have used the following procedure: https://askubuntu.com/a/909915
Is it incorrect?
thaJeztah commented Aug 8, 2017
Yes, that information is outdated; ubuntu zesty is now supported, and packages available; see the installation manual: https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/
If you want all the installation steps to be done «automatically», you can also use the installation script at https://get.docker.com/
konopik commented Aug 8, 2017
YES, now, it works correctly.
I have uninstalled and purged the docker from the system, removed the source and then proceeded according to the link you have provided me. Now, everything works correctly.
thaJeztah commented Aug 8, 2017
Perfect! Let me close this issue as it doesn’t seem to be a bug then 👍
PaulDubar commented Oct 31, 2018
I am having this issue myself right now on this setup
My setup is on Ubuntu 18.04.1 LTS
Client:
Version: 18.06.1-ce
API version: 1.38
Go version: go1.10.4
Git commit: e68fc7a
Built: Mon Oct 1 14:25:31 2018
OS/Arch: linux/amd64
Experimental: false
Server:
Engine:
Version: 18.06.1-ce
API version: 1.38 (minimum version 1.12)
Go version: go1.10.4
Git commit: e68fc7a
Built: Mon Oct 1 14:25:33 2018
OS/Arch: linux/amd64
Experimental: false
$ docker info
Containers: 2
Running: 2
Paused: 0
Stopped: 0
Images: 4
Server Version: 18.06.1-ce
Storage Driver: aufs
Root Dir: /var/snap/docker/common/var-lib-docker/aufs
Backing Filesystem: extfs
Dirs: 22
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
runc version: N/A (expected: 69663f0bd4b60df09991c08812a60108003fa340)
init version: 949e6fa (expected: fec3683)
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.15.0-38-generic
Operating System: Ubuntu Core 16
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 15.53GiB
Name: nas01
ID: VBWG:KG3H:M7IZ:CTXP:43ZL:GFDN:A2CI:3HTJ:CSOA:YWF4:MXOR:NMSX
Docker Root Dir: /var/snap/docker/common/var-lib-docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: 41
Goroutines: 58
System Time: 2018-10-31T02:40:30.077914945Z
EventsListeners: 0
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
docker was installed as part of a fresh host OS installation.
Источник
Docker run fails with «read-only file system» #749
Comments
farzadmf commented Jan 20, 2019 •
I’m on Ubuntu 18.10, and I’m trying to run a .NET Core project in VSCode with to Dockerfile being added by running the command `Docker: Add Docker Files to Workspace».
Here’s my configuration
And, a screenshot of my project structure:
And, my (auto-generated) Dockerfile:
But when I try to start the project, I see this error in my output window:
Am I missing something here?
It may be worth mentioning that on my machine, I can run docker commands without sudo
The text was updated successfully, but these errors were encountered:
philliphoff commented Jan 22, 2019
@farzadmf What version of Docker is installed? Is it the «snap» ( docker-snap ) version or the «standard» ( docker-ce ) version?
farzadmf commented Jan 22, 2019 •
@philliphoff I installed it using snap install docker ; this is the result of snap list :
philliphoff commented Jan 23, 2019
@farzadmf From the error message, it may be related to the use of the snap version of Docker, which seems to have issues creating volumes that mount outside of the user’s home directory. (The Docker extension adds a volume during debugging that mounts to the NuGet package fallback folder on the local machine.)
I’m trying to setup a VM with that same configuration to confirm that; in the meantime, you may have more luck with the «standard» Docker installation.
farzadmf commented Jan 23, 2019
Thank you @philliphoff for your answer, I did what you suggested, and actually, the «standard» Docker installation seems to have a more recent version.
BUT, now I have a very annoying problem that I don’t know how to solve; if you could somehow help me with this, I would really appreciate it.
So, I installed docker using apt , and I’m able to run containers (I had an error is VSCode, but it might be a side effect of this, so I’m trying in «normal» terminal), but when I want to stop the containers, I see this error:
Do you have any idea why that’s happening? I’d appreciate if you help me
philliphoff commented Jan 23, 2019
Maybe related to this @farzadmf? The scenario sounds similar (switching from the Ubuntu packaged Docker to the «standard» one).
Also, is your VS Code installed via snap as well?
farzadmf commented Jan 23, 2019
Thank you @philliphoff for the link. It might have been an issue with groups/users etc. I looked at «Linux post-installation steps» in Docker docs, tried a few commands, restarted a few times, and it seems to be working now.
As for VSCode, it WAS installed using snap , but because of some font issues, I removed it and installed it using the deb package.
And, now that those things are fixed, I tried again with VSCode to run docker, and I get this message:
And when I do docker ps , I see this container is running:
Источник
Error when mounting host path with Docker for Windows — «Permission Denied» #3385
Comments
Teodelas commented Feb 13, 2019
Expected behavior
I’m not able to do a docker run … I get the error below. I’m trying to run a Linux container on Windows 10.
error while creating mount source path ‘/host_mnt/c/Users/xyz/AppData/Roaming/Microsoft/UserSecrets’: mkdir /host_mnt/c/Users/xyz/AppData: permission denied.
Actual behavior
Run the container successfully
Information
- Windows Version: Windows 10
- Docker for Windows Version: 2.0.0.0-win78 (28905)
I checked the Drive sharing config and Drive sharing is enabled with credentials that have local admin rights on my machine.
Steps to reproduce the behavior
The text was updated successfully, but these errors were encountered:
flummingbird commented May 2, 2019
Same problem here.
hypdeb commented May 17, 2019
Same here.
For context, I have an Azure Active Directory account and I had to create another local one with the same name to be able to use Docker AT ALL. But it seems to still be unable to mount folders inside the user directories.
ZeroWiggliness commented May 17, 2019 •
Also have this problem. Creates volumes fine once you add the local account, the container just cant access them. Doesn’t seem matter what rights I put on the .docker folder either for the new account user.
Also see «Error response from daemon: error while creating mount source path ‘/host_mnt/c/Users//.docker/Volumes/elasticdata-elasticsearch-0/pvc-64d22745-7883-11e9-9d67-00155d021b09’: mkdir /host_mnt/c/Users//.docker: permission denied» when inspecting the pod. File exists in the user directory and no issue with volumes themselves it seems.
Tried unsuccessfully to find a way to change the directory for these volumes to somewhere I would have more control as having them on another drive would be useful also.
ZeroWiggliness commented May 17, 2019
The solution seems to be to add the Users group to the .docker folder and grant full access. Just the new local account access wasn’t enough for me.
daton89 commented Jun 3, 2019
@DarrenV79 could you please explain in more details how to add Users group to .docker folder and grant full access? thanks in advance
alexkoepke commented Jun 14, 2019
@daton89 To add a group to a directory you in windows follow these steps:
- Right-click the dir
- Click properties
- click the security tab
- click the «Edit» button.
- click the add button
- Type «users» in the text box
- click «Check Names» (should auto fill/update for you)
- click okay
- Highlight your newly added group.
10 . Under «Permissions for [User/Groupname]» select Full control - click apply
- Click «OK»
- Click «OK»
With all that out of the way I will report that adding the «Users» group to just the .docker file in my c:Users[home].docker dir did not work.
What did work was having the Users group added to at least the .docker, the great great great grandparent dir of my working dir, and the local dir I was trying to mount to my container.
freerider7777 commented Jun 20, 2019
Same problem. Trying to give access to users.
alexkoepke commented Jul 23, 2019
@freerider7777 were you able to resolve your issue?
freerider7777 commented Jul 23, 2019
@alexkoepke Yes, I gave permissions from @DarrenV79’s workaround and it worked
Hopp3r commented Aug 22, 2019
What did work was having the Users group added to at least the .docker, the great great great grandparent dir of my working dir, and the local dir I was trying to mount to my container.
@alexkoepke this solved it for me as well
palbrecht1 commented Sep 18, 2019 •
@DarrenV79 ‘s answer solved my issue as well.
tedchirvasiu commented Sep 19, 2019
Giving full permissions only to the .docker folder didn’t seem to work for me. Giving full permissions to the entire User folder seemed to do the trick, even though it is nasty.
My setup is as follows:
- I have a primary account called «User» onto which I’m currently logged in and do my development work
- I have a user called «DockerDiskSharing» with full admin rights, which I intend to use for Docker to run with
The steps I took were:
- I opened a command prompt with admin rights and added the DockerDiskSharing user to the docker-users group by running
net localgroups docker-users DockerDiskSharing /add
- I went to Docker -> Settings -> Shared Drives, I clicked «Reset credentials» and added the DockerDiskSharing user’s credentials. I ticked C drive (my main partition) and the D drive (where my project is located)
- I opened a command prompt with admin rights and gave full access permissions to the entire Users/User folder by running:
icacls «C:UsersUser» /q /c /t /grant docker-users:F
Still unsure which folders in particular it needs permissions to read/write to though from Users/User but it worked.
Источник
I want to create a Docker container which has a volume mounted from a user-created directory in the root of the Docker host. The host is an Ubuntu EC2 instance.
The Error
I’d like to mount the /data
directory below in a Docker container, but I get the error shown:
ubuntu:~$ ls -l /
total 120
drwxr-xr-x 25 root root 4096 Aug 10 20:51 ./
drwxr-xr-x 25 root root 4096 Aug 10 20:51 ../
drwxr-xr-x 2 root root 4096 Jul 22 13:50 bin/
drwxr-xr-x 3 root root 4096 Jul 22 13:50 boot/
drwxr-xr-x 4 ubuntu ubuntu 4096 Aug 10 19:58 data/
...
drwxr-xr-x 8 root root 4096 May 30 12:19 home/
...
drwxr-xr-x 3 root root 4096 Jun 20 13:39 mnt/
...
drwxr-xr-x 12 root root 4096 Jun 12 01:03 usr/
ubuntu:~$ docker run -it --rm -v /data:/data alpine
docker: Error response from daemon: error while creating mount source path '/data': mkdir /data: read-only file system.
The same command works if I use a directory that came with the instance (e.g. /usr
):
ubuntu:~$ docker run -it --rm -v /usr:/data alpine
/ # ls /data
bin games include lib lib32 local sbin share src
Additional Information
I get the same error, even if I do the following:
- Using
--mount
instead of-v
, even with thereadonly
option. - Execute the command above with
sudo
. - Changed the permissions on
/
anddata
directory to777
- Changed ownership from
ubuntu
toroot
- Mount a subdirectory such as
/data/subdir
.
The df
command indicates that there are no special mounts on the root of the instance:
ubuntu:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 7.9G 0 7.9G 0% /dev
tmpfs 1.6G 872K 1.6G 1% /run
/dev/xvda1 194G 180G 14G 93% /
tmpfs 7.9G 0 7.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 7.9G 0 7.9G 0% /sys/fs/cgroup
/dev/loop0 132M 132M 0 100% /snap/docker/796
/dev/loop2 25M 25M 0 100% /snap/amazon-ssm-agent/4046
/dev/loop3 56M 56M 0 100% /snap/core18/2128
/dev/loop1 100M 100M 0 100% /snap/core/11316
/dev/loop4 100M 100M 0 100% /snap/core/11420
/dev/loop5 56M 56M 0 100% /snap/core18/2074
/dev/loop6 34M 34M 0 100% /snap/amazon-ssm-agent/3552
s3fs 256T 0 256T 0% /mnt/s3
tmpfs 1.6G 0 1.6G 0% /run/user/1000
The docker daemon is running as root:
ubuntu:~/$ ps -ef | grep dockerd
root 964 1 1 19:49 ? 00:00:55 dockerd --group docker --exec-root=/run/snap.docker --data-root=/var/snap/docker/common/var-lib-docker --pidfile=/run/snap.docker/docker.pid --config-file=/var/snap/docker/796/config/daemon.json
root 1302 1 0 19:49 ? 00:00:01 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
ubuntu 6868 2649 0 21:20 pts/1 00:00:00 grep --color=auto dockerd
Thanks in advance. This is a vexing problem and I would have thought it would be easy in Docker and AWS/EC2.