Skip to content

Switch to Docker anonymous volumes #3

@Raimo33

Description

@Raimo33

I propose using docker anonymous volumes for tor/ and i2p/ instead of bind mounts on the host. I argue it is better UX if only the Knots directory should be customizable by the user and the other are managed internally completely by docker.

This addresses also the issue that can arise if a user has tor already installed on the host for other reasons.

Currently it is hard to implement because of user ownership and permissions. Docker named volumes are owned by root by default, and that can only be changed either manually or with docker-compose commands such as post_start like this:

services:
  app:
    image: tor
    user: 1001
    volumes:
      - tor-data:/var/lib/tor    
    post_start:
      - command: chown -R /data 1001:1001
        user: root

volumes:
  tor-data: {}

But in the current state of Docker, post_start is not guaranteed to run immediately. So if entrypoint scripts need immediately to access the volume, the build fails

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions