Skip to content

Commit

Permalink
docs: add imagepullsecret & volume mount steps
Browse files Browse the repository at this point in the history
  • Loading branch information
ericpaulsen committed Oct 18, 2023
1 parent bf04f2e commit f807de0
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,47 @@ After you have a configuration that resembles the following:

`base64` encode the JSON and provide it to envbuilder as the `DOCKER_CONFIG_BASE64` environment variable.

Alternatively, if running `envbuilder` in Kubernetes, you can create an `ImagePullSecret` and
pass it into the pod as a volume mount:

```shell
# Artifactory example
kubectl create secret docker-registry regcred \
--docker-server=my-artifactory.jfrog.io \
--docker-username=read-only \
--docker-password=secret-pass \
--docker-email=me@example.com \
-n coder
```

```hcl
resource "kubernetes_deployment" "example" {
metadata {
namespace = coder
}
spec {
spec {
container {
# Define the volumeMount with the pull credentials
volume_mount {
name = "docker-config-volume"
mount_path = "/envbuilder/config.json"
sub_path = ".dockerconfigjson"
}
# ... other container configurations
}
# Define the volume which maps to the pull credentials
volume {
name = "docker-config-volume"
secret {
secret_name = "regcred"
}
}
}
}
}
```

### Docker Hub

Authenticate with `docker login` to generate `~/.docker/config.json`. Encode this file using the `base64` command:
Expand Down

0 comments on commit f807de0

Please sign in to comment.