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

Add a Docker entrypoint script and modify Dockerfiles to mimic Vault, to enable mlock inside Docker containers #1269

Merged
merged 5 commits into from
Jun 8, 2021

Conversation

omkensey
Copy link
Contributor

@omkensey omkensey commented Jun 3, 2021

  • Add entrypoint script with logic borrowed from Vault's. This script adds
    IPC_LOCK capability at runtime and then executes Boundary under its own user.

  • Modify Dockerfiles to use the entrypoint script.

  • Remove USER directives from the Boundary Dockerfiles. This is required to
    allow the entrypoint to run setcap.

Because Boundary itself is no longer the entrypoint, the behavior of the
container with respect to passing or overriding arguments is different now.
The Vault script's logic around handling this was not copied entirely -- only
to the extent required to allow the server subcommand to run properly.

… to enable mlock.

* Add entrypoint script with logic borrowed from Vault's.  This script adds
IPC_LOCK capability at runtime and then executes Boundary under its own user.

* Modify Dockerfiles to use the entrypoint script.

* Remove USER directives from the Boundary Dockerfiles.  This is required to
allow the entrypoint to run setcap.

Because Boundary itself is no longer the entrypoint, the behavior of the
container with respect to passing or overriding arguments is different now.
The Vault script's logic around handling this was not copied entirely -- only
to the extent required to allow the `server` subcommand to run properly.
@hashicorp-cla
Copy link

hashicorp-cla commented Jun 3, 2021

CLA assistant check
All committers have signed the CLA.

@omkensey omkensey changed the title Add a Docker entrypoint script and modify Dockerfiles to mimic Vault, to enable mlock Add a Docker entrypoint script and modify Dockerfiles to mimic Vault, to enable mlock inside Docker containers Jun 3, 2021
Copy link
Collaborator

@malnick malnick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks Joe!

@malnick malnick added this to the 0.3.0 milestone Jun 8, 2021
@malnick malnick merged commit cc843dd into hashicorp:main Jun 8, 2021
@paladin-devops
Copy link

I'm running the Docker container for Boundary v0.7.1, but I'm running into the IPC lock error message when my Boundary container starts up.

Couldn't start Boundary with IPC_LOCK. Disabling IPC_LOCK, please use --privileged or --cap-add IPC_LOCK

@omkensey
Copy link
Contributor Author

I'm running the Docker container for Boundary v0.7.1, but I'm running into the IPC lock error message when my Boundary container starts up.

Couldn't start Boundary with IPC_LOCK. Disabling IPC_LOCK, please use --privileged or --cap-add IPC_LOCK

You'll still get that if you run it as an ordinary docker run, because Docker doesn't add that capability by default. But if you add --cap-add IPC_LOCK (or add that capability in the Boundary container config in whatever orchestrator you're using) then mlock should be enabled and you won't see that error any more.

@paladin-devops
Copy link

@omkensey thanks for getting back to me on this! My problem was that I added the "ipc_lock" capability and not "IPC_LOCK". :) In this case I was using Nomad.

hugoghx pushed a commit that referenced this pull request Dec 6, 2024
* bump ui commit to 64e568bd (#5150)

* test(e2e): Add user name to AWS resources (#5149)

This change makes it easier to identify who generated these resources when looking at the AWS console

* update CHANGELOG with UI specific updates (#5156)

* bump ui commit to 0d55812 (#5158)

* Update multi-hop.mdx (#5153)

* Update multi-hop.mdx

added blurb about using HCP-managed workers for outbound-only scenarios.

* Update multi-hop.mdx

misspelled "intermediary"

* docs: Minor rewrite

---------

Co-authored-by: Dan Heath <[email protected]>

* Update controller.mdx - public_cluster_addr (#5151)

* Update controller.mdx - public_cluster_addr

Updating public_cluster_addr to indicate that it is used if a load balancer is used for controllers. Also added a note about not including https:// and http:// in the address

* docs: Minor rewrite

* docs: Minor rewrite

---------

Co-authored-by: Dan Heath <[email protected]>

* Rab create bucket add filters link (#5157)

* adds link to worker filters examples

* adds terraform tabs for minio and s3-compliant storage

* internal/clientcache/cmd/cache: restart cache on version mismatch (#5165)

Restart the client cache if it is found to be a version below the
version of the CLI during client cache hook execution.

---------

Co-authored-by: Cameron Perera <[email protected]>
Co-authored-by: Michael Li <[email protected]>
Co-authored-by: vanphan24 <[email protected]>
Co-authored-by: Dan Heath <[email protected]>
Co-authored-by: Robin Beck <[email protected]>
Co-authored-by: Johan Brandhorst-Satzkorn <[email protected]>
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.

4 participants