Updates the docs (#165). Closes #158

* updates the docs due to the changes of #147
* adds documentation for the ssh usage option of #153
* updates docs for usage of the os credentials helpers
* adds pathexpand for config_file in docs
This commit is contained in:
Manuel Vogel 2019-07-17 19:02:02 +02:00 committed by GitHub
parent 51d84e4a94
commit bb72bf31bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 14 deletions

View file

@ -35,6 +35,16 @@ resource "docker_image" "ubuntu" {
}
```
-> **Note**
You can also use the `ssh` protocol to connect to the docker host on a remote machine.
The configuration would look as follows:
```hcl
provider "docker" {
host = "ssh://user@remote-host:22"
}
```
## Registry Credentials
Registry credentials can be provided on a per-registry basis with the `registry_auth`
@ -49,7 +59,7 @@ provider "docker" {
registry_auth {
address = "registry.hub.docker.com"
config_file = "~/.docker/config.json"
config_file = "${pathexpand("~/.docker/config.json")}"
}
registry_auth {
@ -69,25 +79,25 @@ data "docker_registry_image" "quay" {
```
-> **Note**
When passing in a config file make sure every repo in the `auths` object should have
a corresponding `auth` string.
When passing in a config file either the corresponding `auth` string of the repository is read or the os specific
credential helpers (see [here](https://github.com/docker/docker-credential-helpers#available-programs)) are
used to retrieve the authentication credentials.
In this case, either use `username` and `password` directly or set the enviroment variables `DOCKER_REGISTRY_USER` and `DOCKER_REGISTRY_PASS` or add the string manually via
You can still use the enviroment variables `DOCKER_REGISTRY_USER` and `DOCKER_REGISTRY_PASS`.
```sh
echo -n "user:pass" | base64
# dXNlcjpwYXNz=
```
and paste it into `~/.docker/config.json`:
An example content of the file `~/.docker/config.json` on OSX may look like follows:
```json
{
"auths": {
"repo.mycompany:8181": {
"auth": "dXNlcjpwYXNz="
},
"otherrepo.other-company:8181": {
}
}
},
"credsStore" : "osxkeychain"
}
```

View file

@ -144,9 +144,7 @@ supports the following:
* `volume_options` - (Optional, map) Optional configuration for the `volume` type.
* `no_copy` - (Optional, string) Whether to populate volume with data from the target.
* `labels` - (Optional, map of key/value pairs) Adding labels.
* `driver_config` - (Optional, map) The name of the driver to create the volume.
* `name` - (Optional, string) The name of the driver to create the volume.
* `options` - (Optional, map of key/value pairs) Options for the driver.
* `driver_options` - (Optional, map of key/value pairs) Options for the driver.
* `tmpfs_options` - (Optional, map) Optional configuration for the `tmpf` type.
* `size_bytes` - (Optional, int) The size for the tmpfs mount in bytes.
* `mode` - (Optional, int) The permission mode for the tmpfs mount in an integer.