Skip to content

Commit

Permalink
Update docker integration
Browse files Browse the repository at this point in the history
  • Loading branch information
maidul98 committed Jan 22, 2023
1 parent 4db4c17 commit 4b4e8e2
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions docs/integrations/platforms/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,22 @@ Infisical can be used in a Dockerfile to inject environment variables into a Doc
</Tab>
</Tabs>

## Modify the start command in your Dockerfile
## Modify your Dockerfile start command

```dockerfile
CMD ["infisical", "--env=[env]", "projectId=[projectId]", "run", "---", "[your application start command]"]
To make your Docker container consume Infisical secrets, you can start your application with Infisical.
This will automatically pull the necessary secrets and make them available to your application as if they were natively exposed within the container.

# example
CMD ["infisical", "--env=prod", "projectId=62faf98ae0b05e83239b5da41", "run", "---", "npm run start"]
```
```dockerfile
CMD ["infisical", "run", "---", "[your application start command]"]

Required options:
# example with single single command
CMD ["infisical", "run", "---", "npm run start"]

| Option | Description | Default value |
| ------------- | ----------------------------------------------------------------------------------------------------------- | ------------- |
| `--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` |
# example with multiple commands
CMD ["infisical", "run", "--command" "npm run start && ..."]
```

## Generate an Infisical Token

[Generate an Infisical Token](../../getting-started/dashboard/token) and keep it handy.
View more options for the `run` command [here](../../cli/commands/run)

## Feed Docker your Infisical Token

Expand All @@ -58,3 +55,8 @@ The CLI looks out for an environment variable called `INFISICAL_TOKEN`. If the t
```bash
docker run --env INFISICAL_TOKEN=[token]...
```

## Generate an Infisical Token

[Generate an Infisical Token](../../getting-started/dashboard/token) and keep it handy.

0 comments on commit 4b4e8e2

Please sign in to comment.