[GH-ISSUE #42] Docker bind volume ownership/permissions and goeland.db #18

Closed
opened 2026-09-29 12:58:38 +00:00 by slurdge · 4 comments
Owner

Originally created by @kriswilk on GitHub (Jun 11, 2022).
Original GitHub issue: https://github.com/slurdge/goeland/issues/42

Since you now offer a docker image, I put together a docker-compose.yml file containing:

services:
  app:
    image: slurdge/goeland
    restart: unless-stopped
    volumes:
      - ~/docker/volumes/goeland:/data

Issues I've encountered:

  • Unless I first create ~/docker/volumes/goeland (as user 1000), it gets created by docker as root and config.toml cannot be written to it. Shouldn't it be created automatically by docker as the container user (1000?) and just work?
  • Even when config.toml is created/edited, successfully, a "permission denied" error occurs when creating goeland.db.

I admit that I'm pretty new to docker (and to goeland!), so perhaps this is all expected behaviour and I'm "doing it wrong". Either way, I'm hoping for guidance.

P.S. is there a way to default the container to start with the --run-at-startup flag?

Originally created by @kriswilk on GitHub (Jun 11, 2022). Original GitHub issue: https://github.com/slurdge/goeland/issues/42 Since you now offer a docker image, I put together a `docker-compose.yml` file containing: ``` services: app: image: slurdge/goeland restart: unless-stopped volumes: - ~/docker/volumes/goeland:/data ``` Issues I've encountered: - Unless I first create `~/docker/volumes/goeland` (as user 1000), it gets created by docker as root and `config.toml` cannot be written to it. Shouldn't it be created automatically by docker as the container user (1000?) and just work? - Even when `config.toml` is created/edited, successfully, a "permission denied" error occurs when creating `goeland.db`. I admit that I'm pretty new to docker (and to goeland!), so perhaps this is all expected behaviour and I'm "doing it wrong". Either way, I'm hoping for guidance. P.S. is there a way to default the container to start with the `--run-at-startup` flag?
Author
Owner

@slurdge commented on GitHub (Jun 12, 2022):

* Unless I first create `~/docker/volumes/goeland` (as user 1000), it gets created by docker as root and `config.toml` cannot be written to it. Shouldn't it be created automatically by docker as the container user (1000?) and just work?

Yes it should, I would have to look at it. Probably something to do with running as root or not.

* Even when `config.toml` is created/edited, successfully, a "permission denied" error occurs when creating `goeland.db`.

This should work too. Docker image are quite new, so there needs to have more tests. I'll look into it.

I admit that I'm pretty new to docker (and to goeland!), so perhaps this is all expected behaviour and I'm "doing it wrong". Either way, I'm hoping for guidance.

My goal is to have an example docker-compose.yml file.

P.S. is there a way to default the container to start with the --run-at-startup flag?

Yes, all command line args should be mirrored with environment variables. So if you set GOELAND_RUN_AT_STARTUP=true it should do as you wish.

<!-- gh-comment-id:1153182064 --> @slurdge commented on GitHub (Jun 12, 2022): > * Unless I first create `~/docker/volumes/goeland` (as user 1000), it gets created by docker as root and `config.toml` cannot be written to it. Shouldn't it be created automatically by docker as the container user (1000?) and just work? Yes it should, I would have to look at it. Probably something to do with running as root or not. > > * Even when `config.toml` is created/edited, successfully, a "permission denied" error occurs when creating `goeland.db`. > This should work too. Docker image are quite new, so there needs to have more tests. I'll look into it. > I admit that I'm pretty new to docker (and to goeland!), so perhaps this is all expected behaviour and I'm "doing it wrong". Either way, I'm hoping for guidance. My goal is to have an example `docker-compose.yml` file. > P.S. is there a way to default the container to start with the `--run-at-startup` flag? Yes, all command line args should be mirrored with environment variables. So if you set `GOELAND_RUN_AT_STARTUP=true` it should do as you wish.
Author
Owner

@kriswilk commented on GitHub (Jun 12, 2022):

My goal is to have an example docker-compose.yml file.

That's a good idea. A minimalist example could be similar to mine but with an even simpler persistent volume alongside the docker-compose.yml file:

services:
  app:
    image: slurdge/goeland
    restart: unless-stopped
    volumes:
      - ./goeland:/data

Yes, all command line args should be mirrored with environment variables. So if you set GOELAND_RUN_AT_STARTUP=true it should do as you wish.

Hmm. I just tried this by augmenting my docker-compose.yml:

services:
  app:
    image: slurdge/goeland
    restart: unless-stopped
    environment:
      - GOELAND_RUN_AT_STARTUP=true
    volumes:
      - ~/docker/volumes/goeland:/data

But it didn't have any effect. Where is this implemented in the code? I can't seem to see where it's pulled from an env variable. Or did you mean that this is a planned feature?

<!-- gh-comment-id:1153198925 --> @kriswilk commented on GitHub (Jun 12, 2022): > My goal is to have an example `docker-compose.yml` file. That's a good idea. A minimalist example could be similar to mine but with an even simpler persistent volume alongside the docker-compose.yml file: ``` services: app: image: slurdge/goeland restart: unless-stopped volumes: - ./goeland:/data ``` > Yes, all command line args should be mirrored with environment variables. So if you set `GOELAND_RUN_AT_STARTUP=true` it should do as you wish. Hmm. I just tried this by augmenting my `docker-compose.yml`: ``` services: app: image: slurdge/goeland restart: unless-stopped environment: - GOELAND_RUN_AT_STARTUP=true volumes: - ~/docker/volumes/goeland:/data ``` But it didn't have any effect. Where is this implemented in the code? I can't seem to see where it's pulled from an env variable. Or did you mean that this is a planned feature?
Author
Owner

@slurdge commented on GitHub (Jun 12, 2022):

The binding is here:
a3f261360a/config/config.go (L38)
But I realize I may need to explicitly create a configuration variable bound to the command line for it to work.

<!-- gh-comment-id:1153274043 --> @slurdge commented on GitHub (Jun 12, 2022): The binding is here: https://github.com/slurdge/goeland/blob/a3f261360a78a4496807fec72dcaf4d2c5e122a1/config/config.go#L38 But I realize I may need to explicitly create a configuration variable bound to the command line for it to work.
Author
Owner

@slurdge commented on GitHub (Aug 4, 2022):

Should be ok now. Sorry for the delay.

<!-- gh-comment-id:1205383636 --> @slurdge commented on GitHub (Aug 4, 2022): Should be ok now. Sorry for the delay.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: slurdge/goeland#18
No description provided.