Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run container as non root (2) #362

Merged
merged 1 commit into from
Oct 15, 2020

Conversation

BobyMCbobs
Copy link
Contributor

@BobyMCbobs BobyMCbobs commented Oct 14, 2020

Goal

This PR removes extra dependencies in the container image to run as a non-root user, instead defaulting all processes to run as root from the entrypoint.
This is important, as an exec's into the container image will not run as root, unlike currently.

Changes

Please describe the changes made in the pull request here.

Below you'll find a checklist. For each item on the list, check one option and delete the other.

Tests

  • Automated tests have been added
  • This PR does not require tests

Changelog

  • Entry has been added to changelog
  • This PR does not make a user-facing change

Documentation

  • Docs have been updated
  • This change does not need a documentation update

Notes

The changes of the previous PR were regressed due to #360.

Initialising succeeds from the following commands:

        command:
        - /bin/sh
        - -c
        - /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh db init-admin

and shows the logs

# kubectl -n plausible logs plausible-5689584dd5-pt5zs -c plausible-init
Loading plausible..
Starting dependencies..
Starting repos..
create Plausible.Repo database if it doesn't exist
create Plausible.ClickhouseRepo database if it doesn't exist
Creation of Db successful!
Loading plausible..
Starting dependencies..
Starting repos..
Running migrations for Elixir.Plausible.Repo
Running migrations for Elixir.Plausible.ClickhouseRepo
Migrations successful!
Loading plausible..
Starting dependencies..
Starting repos..
Admin user already exists. I won't override, bailing

@ukutaht
Copy link
Contributor

ukutaht commented Oct 15, 2020

Looks good to me

@ukutaht ukutaht merged commit f7235d4 into plausible:master Oct 15, 2020
@BobyMCbobs
Copy link
Contributor Author

Looks good to me

Thank you, @ukutaht!

ukutaht pushed a commit that referenced this pull request Oct 15, 2020
ukutaht added a commit that referenced this pull request Oct 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants