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

feat(spin): Container improvements, non-root, exec spin, :latest tag #331

Merged
merged 2 commits into from
Mar 18, 2022

Conversation

kskewes-sf
Copy link
Contributor

Following the principle of least privilege we should not run as root
user. There is no need.
Match other Spinnaker services and run as a high user id.

Additional containers generally run the application process as
the entrypoint rather than a shell.
This makes performing commands simpler as we can tack on any arguments
to the end of the image like so:

$ docker run --rm -it spin:latest --version
version dev

The VERSION build arg now defaults to dev otherwise an empty VERSION
string overwrites default in Go and results in the --version flag
disappearing.

Following the principle of least privilege we should not run as root
user. There is no need.
Match other Spinnaker services and run as a high user id.

Additional containers generally run the application process as
the entrypoint rather than a shell.
This makes performing commands simpler as we can tack on any arguments
to the end of the image like so:

```
$ docker run --rm -it spin:latest --version
version dev
```

The `VERSION` build arg now defaults to `dev` otherwise an empty VERSION
string overwrites default in Go and results in the `--version` flag
disappearing.
We have a convention in Spinnaker land of tagging containers with
`master-latest-unvalidated`.
`master` comes from the branch (master|release-*) and for `master` could
potentially be dropped.
`unvalidated` is used because of nightly integration tests which haven't
been used with `spin` before.

All in all push `:latest` tag on successful CI run for master commits.
Standard UX in container-land.
@kskewes-sf kskewes-sf changed the title feat(spin): Run container as non-root user and exec spin feat(spin): Container improvements, non-root, exec spin, :latest tag Mar 18, 2022
@mattgogerly mattgogerly added the ready to merge Approved and Reviewed and ready for merge label Mar 18, 2022
@mergify mergify bot added the auto merged label Mar 18, 2022
@dbyron-sf dbyron-sf merged commit 22668fd into spinnaker:master Mar 18, 2022
@kskewes-sf kskewes-sf deleted the container-user branch April 27, 2022 23:53
@kskewes-sf kskewes-sf restored the container-user branch July 14, 2022 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto merged ready to merge Approved and Reviewed and ready for merge target-release/1.28
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants