Skip to content

ClickHouse + Docker + Linux + DevZone: unable to start first one due to explicit chown usage #3828

@pztrn

Description

@pztrn

entrypoint.sh forces chown which prevents from launching clickhouse in devzone with docker-compose and user parameter, like:

  clickhouse_one:
    depends_on:
      - zookeeper_one
      - zookeeper_two
      - zookeeper_three
    image: "yandex/clickhouse-server"
    ports:
      # HTTP interface
      - "18123:18123"
      # Native interface.
      - "19000:19000"
    volumes:
      - "./configs/clickhouse/one/config.xml:/etc/clickhouse-server/config.xml"
      - "./configs/clickhouse/common/includes.xml:/etc/clickhouse-server/includes.xml"
      - "./data/clickhouse/one/:/var/lib/clickhouse/"
    ulimits:
      nofile:
        soft: 1000000
        hard: 1000000
    user: ${USER_ID}

${USER_ID} expands to current user's ID in system.

The reason why it was done that way is to provide all developers a single shell script and docker-compose.yaml that will "just start" development zone in Docker as non-root user. Without user it works fine on macOS because it translates IDs used by your container(s) into real system's ones (so your container user with id=101 became system's user with id=501), but Linux doesn't work like this.

Can you please update entrypoint.sh to workaround that? My suggestion is to use environment variable (e.g. DO_NOT_CHOWN) or something like that or use environment variables for providing uid:gid pair to chown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions