Skip to content

Commit

Permalink
docs: add imagepullsecret & volume mount steps (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericpaulsen authored Oct 19, 2023
1 parent bf04f2e commit 500da9a
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,46 @@ 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. This example will work for all registries.

```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"
}
}
# 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 500da9a

Please sign in to comment.