Skip to content

run application as non-root user in docker container - #575

Merged
m90 merged 4 commits into
developmentfrom
nonroot-docker
Mar 18, 2021
Merged

run application as non-root user in docker container#575
m90 merged 4 commits into
developmentfrom
nonroot-docker

Conversation

@m90

@m90 m90 commented Mar 18, 2021

Copy link
Copy Markdown
Member

This models the Dockerfile after the advice given here https://github.com/hexops/dockerfile which seems to make a lot of sense.

Trouble with this approach is that it will require manual interaction by users that upgrade, so we might need to wait for a proper point in time to sneak this in.

@m90

m90 commented Mar 18, 2021

Copy link
Copy Markdown
Member Author

Changing file ownership in the container would work like this:

docker exec -u 0 <container_ref> chown offen:offen /var/opt/offen/offen.db

@m90 m90 added the breaking label Mar 18, 2021
@m90
m90 force-pushed the nonroot-docker branch from 3d543b7 to 05c6eca Compare March 18, 2021 08:41
@m90

m90 commented Mar 18, 2021

Copy link
Copy Markdown
Member Author

A possible migration strategy for moving here might be:

  1. Starting with v0.4.0 we make the non-root Docker image the default, providing instructions on how to migrate. This should only affect deployments that use the Docker / SQLite combo.
  2. For the entire v0.4.x series we also provide a v0.4.x-root tag on Docker Hub that still uses the Docker Image running as root. This leaves users with a little more time to migrate while still keeping the installs up to date.
  3. Starting with v0.5.0 the image running as root is dropped. Anyone who wants to upgrade will need to run the upgrade steps against their setups.

@m90
m90 force-pushed the nonroot-docker branch from 85b151b to c40684b Compare March 18, 2021 11:27
@m90
m90 merged commit a908efc into development Mar 18, 2021
@m90
m90 deleted the nonroot-docker branch March 18, 2021 16:44
@m90 m90 mentioned this pull request Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant