mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-03 05:25:56 +00:00
Update docker integration
This commit is contained in:
@@ -31,25 +31,22 @@ Infisical can be used in a Dockerfile to inject environment variables into a Doc
|
|||||||
</Tab>
|
</Tab>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
||||||
## Modify the start command in your Dockerfile
|
## Modify your Dockerfile start command
|
||||||
|
|
||||||
```dockerfile
|
To make your Docker container consume Infisical secrets, you can start your application with Infisical.
|
||||||
CMD ["infisical", "--env=[env]", "projectId=[projectId]", "run", "---", "[your application start command]"]
|
This will automatically pull the necessary secrets and make them available to your application as if they were natively exposed within the container.
|
||||||
|
|
||||||
# example
|
```dockerfile
|
||||||
CMD ["infisical", "--env=prod", "projectId=62faf98ae0b05e83239b5da41", "run", "---", "npm run start"]
|
CMD ["infisical", "run", "---", "[your application start command]"]
|
||||||
```
|
|
||||||
|
|
||||||
Required options:
|
# example with single single command
|
||||||
|
CMD ["infisical", "run", "---", "npm run start"]
|
||||||
|
|
||||||
| Option | Description | Default value |
|
# example with multiple commands
|
||||||
| ------------- | ----------------------------------------------------------------------------------------------------------- | ------------- |
|
CMD ["infisical", "run", "--command" "npm run start && ..."]
|
||||||
| `--env` | Used to set the environment that secrets are pulled from. Accepted values: `dev`, `staging`, `test`, `prod` | `dev` |
|
```
|
||||||
| `--projectId` | Used to link a local project to the platform | `None` |
|
|
||||||
|
|
||||||
## Generate an Infisical Token
|
View more options for the `run` command [here](../../cli/commands/run)
|
||||||
|
|
||||||
[Generate an Infisical Token](../../getting-started/dashboard/token) and keep it handy.
|
|
||||||
|
|
||||||
## Feed Docker your Infisical Token
|
## Feed Docker your Infisical Token
|
||||||
|
|
||||||
@@ -58,3 +55,8 @@ The CLI looks out for an environment variable called `INFISICAL_TOKEN`. If the t
|
|||||||
```bash
|
```bash
|
||||||
docker run --env INFISICAL_TOKEN=[token]...
|
docker run --env INFISICAL_TOKEN=[token]...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Generate an Infisical Token
|
||||||
|
|
||||||
|
[Generate an Infisical Token](../../getting-started/dashboard/token) and keep it handy.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user