Merge pull request #2025 from helderco/clirun-mounts
Fix mounts in `cli.#Run`
This commit is contained in:
commit
85072c500a
@ -51,42 +51,47 @@ import (
|
|||||||
docker.#Run & {
|
docker.#Run & {
|
||||||
env: DOCKER_HOST: host
|
env: DOCKER_HOST: host
|
||||||
|
|
||||||
|
mounts: {
|
||||||
if ssh.key != _|_ {
|
if ssh.key != _|_ {
|
||||||
mounts: ssh_key: {
|
ssh_key: {
|
||||||
dest: "/root/.ssh/id_rsa"
|
dest: "/root/.ssh/id_rsa"
|
||||||
contents: ssh.key
|
contents: ssh.key
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ssh.knownHosts != _|_ {
|
if ssh.knownHosts != _|_ {
|
||||||
mounts: ssh_hosts: {
|
ssh_hosts: {
|
||||||
dest: "/root/.ssh/known_hosts"
|
dest: "/root/.ssh/known_hosts"
|
||||||
contents: ssh.knownHosts
|
contents: ssh.knownHosts
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Connect via HTTP/HTTPS
|
// Connect via HTTP/HTTPS
|
||||||
#RunTCP: {
|
#RunTCP: {
|
||||||
host: =~"^tcp://.+"
|
host: =~"^tcp://.+"
|
||||||
|
|
||||||
docker.#Run & {
|
|
||||||
env: DOCKER_HOST: host
|
|
||||||
|
|
||||||
// Directory with certificates to verify ({ca,cert,key}.pem files).
|
// Directory with certificates to verify ({ca,cert,key}.pem files).
|
||||||
// This enables HTTPS.
|
// This enables HTTPS.
|
||||||
certs?: dagger.#FS
|
certs?: dagger.#FS
|
||||||
|
|
||||||
if certs != _|_ {
|
docker.#Run & {
|
||||||
env: {
|
env: {
|
||||||
|
DOCKER_HOST: host
|
||||||
|
|
||||||
|
if certs != _|_ {
|
||||||
DOCKER_TLS_VERIFY: "1"
|
DOCKER_TLS_VERIFY: "1"
|
||||||
DOCKER_CERT_PATH: "/certs/client"
|
DOCKER_CERT_PATH: "/certs/client"
|
||||||
}
|
}
|
||||||
mounts: "certs": {
|
}
|
||||||
|
mounts: {
|
||||||
|
if certs != _|_ {
|
||||||
|
"certs": {
|
||||||
dest: "/certs/client"
|
dest: "/certs/client"
|
||||||
contents: certs
|
contents: certs
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user