hashicorp / docker-vault

Official Docker images for Vault
Mozilla Public License 2.0
500 stars 222 forks source link

Unknown plugin type failed to load plugin as database #251

Open geoangelotti opened 2 years ago

geoangelotti commented 2 years ago

When trying to run the secrets_mock plugin inside a docker, I am getting the following issue:

failed to load plugin as database v5: fork/exec /plugins/vault-plugin-secrets-mock: no such file or directory image.

The build process can be seen in this action.

build.yaml

Way to reproduce:

  1. Plugin built outside the container (make build, sudo setcap cap_ipc_lock=+ep ...)
  2. Run the container:
    docker run -d --name notary -p 8200:8200 -v $(pwd)/vault/plugins:/plugins \
    -e 'VAULT_ADDR=http://127.0.0.1:8200' -e 'VAULT_DEV_ROOT_TOKEN_ID=root' -e 'VAULT_DEV_LISTEN_ADDRESS=0.0.0.0:8200' --cap-add=IPC_LOCK \
    $1 sh -c "vault server -dev -dev-root-token-id=root -dev-plugin-dir=/plugins"

The error message says that there is no file or directory at the plugin path but there is. image

laurence-pawling commented 2 years ago

Hi @geoangelotti, I wonder if this is the same issue I've been seeing. Looks like the issue is related to the alpine base: https://fukubaka0825.medium.com/how-to-resolve-the-trouble-occurred-when-i-install-go-into-the-alpine-image-3c1e84f2315a I worked around the issue on my side by re-building the plugin inside the container (I guess creating a temporary alpine container just for the build would also work), but maybe using a different base OS for the vault container would be useful as I imagine lots of plugins will have this problem!