Closed AnisSjd closed 1 year ago
What host os are you running Dokku on?
Host: macOS Ventura 13.3 Docker image: Linux 0442979ce7de 5.15.0-69-generic (from https://hub.docker.com/r/dokku/dokku)
The docker installation notes show environment variables and mounts that need to be set. The host directories should be writeable - if not, you'll get this error. I think thats expected on OSX, so you'll need to use a host path other than /var/lib/dokku
for data.
You are right, I used the instructions at https://hub.docker.com/r/dokku/dokku, instead of the (more complete?) ones at https://dokku.com/docs/getting-started/install/docker/ .
I fixed my previous command, but the issue remains.
Note that I intentionally haven't mounted my host /var/lib/dokku
to avoid bind mount issues as the one you mentionned.
Here is the updated command:
docker run --rm \
--env DOKKU_HOSTNAME=dokku.me \
--env DOKKU_HOST_ROOT=/var/lib/dokku/home/dokku \
--env DOKKU_LIB_HOST_ROOT=/var/lib/dokku/var/lib/dokku \
--name dokku-test \
--publish 3022:22 \
--publish 8080:80 \
--publish 8443:443 \
--volume ${PWD}/plugin-list:/mnt/dokku/plugin-list \
--volume /var/run/docker.sock:/var/run/docker.sock \
dokku/dokku:0.30.2 &
The datastore plugins store data on disk and use the mounted docker socket, so all the directories are mounted from the host.
The host root env vars are used to specify where to mount directories from. Since you set them relative to /var/lib/dokku, that's where data gets mounted from.
OK, the following params let me create the database:
docker run --rm \
--env DOKKU_HOSTNAME=dokku.me \
--env DOKKU_HOST_ROOT=${PWD}/home/dokku \
--env DOKKU_LIB_HOST_ROOT=${PWD}/var/lib/dokku \
--name dokku-test \
--publish 3022:22 \
--publish 8080:80 \
--publish 8443:443 \
--volume ${PWD}/var/lib/dokku:/mnt/dokku \
--volume ${PWD}/plugin-list:/mnt/dokku/plugin-list \
--volume /var/run/docker.sock:/var/run/docker.sock \
dokku/dokku:0.30.2 &
I understand now the importance of DOKKU_LIB_HOST_ROOT; however I'm still unsure of its exact use and limitations, since I can't find enough documentation about it, both at https://hub.docker.com/r/dokku/dokku and https://dokku.com/docs/getting-started/install/docker/.
Thanks for help.
@josegonzalez I am running into the same issue. However I am running on Ubuntu server, from the bootstrap.sh. My docker report is here
sudo dokku postgres:create sample_db
Error response from daemon: error while creating mount source path '/var/lib/dokku/services/postgres/sample_db/data': mkdir /var/lib/dokku: read-only file system
Error: failed to start containers: 835486d8356fff70d64cf8ca1da254db161f9567212d5766643869f6060fdfd3
I managed to resolve the issue by uninstalling the snap docker (snap remove docker
) and reinstalling docker following https://docs.docker.com/engine/install/ubuntu/ then rebooting.
Description of problem
I was following the official app deployment tuto at https://dokku.com/docs/deployment/application-deployment/ with my dokku image (from https://hub.docker.com/r/dokku/dokku), but get stuck with:
How reproducible
It happens every time on my machine, even when I clean the containers created by dokku.
Steps to Reproduce
Actual Results
Expected Results
No error + DB service is created so I can continue the tuto
Environment Information
dokku report
outputHow (deb/make) and where (AWS, VirtualBox, physical, etc.) was Dokku installed?:
Where: macOS Ventura 13.3 @ Macbook Air M1 How: Docker image at https://hub.docker.com/r/dokku/dokku
Additional information
dokku trace:on
: I put only a partial output here, for readability reasons. If asked I can post the full one.