stdlib: docker: clean up docker.#Command inputs
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
parent
e5c571b8a9
commit
322997b74a
@ -31,10 +31,7 @@ A container image that can run any docker command
|
||||
|
||||
### docker.#Command Inputs
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------------- |:-------------: |:-------------: |
|
||||
|*command* | `string` |Command to execute |
|
||||
|*registries* | `[]` |Image registries |
|
||||
_No input._
|
||||
|
||||
### docker.#Command Outputs
|
||||
|
||||
@ -46,12 +43,10 @@ Load a docker image into a docker engine
|
||||
|
||||
### docker.#Load Inputs
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------------- |:-------------: |:-------------: |
|
||||
|*tag* | `string` |Name and optionally a tag in the 'name:tag' format |
|
||||
|*source* | `dagger.#Artifact` |Image source |
|
||||
|*load.command* | `"docker load -i /src/image.tar"` |Command to execute |
|
||||
|*load.registries* | `[]` |Image registries |
|
||||
| Name | Type | Description |
|
||||
| ------------- |:-------------: |:-------------: |
|
||||
|*tag* | `string` |Name and optionally a tag in the 'name:tag' format |
|
||||
|*source* | `dagger.#Artifact` |Image source |
|
||||
|
||||
### docker.#Load Outputs
|
||||
|
||||
@ -98,9 +93,7 @@ Push a docker image to a remote registry
|
||||
| Name | Type | Description |
|
||||
| ------------- |:-------------: |:-------------: |
|
||||
|*ref* | `string` |Image reference (e.g: nginx:alpine) |
|
||||
|*run.command* | `"""\n # Run detach container\n OPTS=""\n \n if [ ! -z "$CONTAINER_NAME" ]; then\n \tOPTS="$OPTS --name $CONTAINER_NAME"\n fi\n \n if [ ! -z "$CONTAINER_PORTS" ]; then\n \tOPTS="$OPTS -p $CONTAINER_PORTS"\n fi\n \n docker container run -d $OPTS "$IMAGE_REF"\n """` |Command to execute |
|
||||
|*run.env.IMAGE_REF* | `string` |- |
|
||||
|*run.registries* | `[]` |Image registries |
|
||||
|
||||
### docker.#Run Outputs
|
||||
|
||||
|
@ -14,14 +14,10 @@ import "alpha.dagger.io/docker/compose"
|
||||
|
||||
### compose.#App Inputs
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------------- |:-------------: |:-------------: |
|
||||
|*name* | `*"source" \| string` |App name (use as COMPOSE_PROJECT_NAME) |
|
||||
|*registries* | `[]` |Image registries |
|
||||
|*run.command* | `"""\n if [ -n "$DOCKER_HOSTNAME" ]; then\n \tssh -i /key -fNT -o "StreamLocalBindUnlink=yes" -L "$(pwd)"/docker.sock:/var/run/docker.sock -p "$DOCKER_PORT" "$DOCKER_USERNAME"@"$DOCKER_HOSTNAME"\n \texport DOCKER_HOST="unix://$(pwd)/docker.sock"\n fi\n \n # Extend session duration\n echo "Host *\\nServerAliveInterval 240" \>\> "$HOME"/.ssh/config\n chmod 600 "$HOME"/.ssh/config\n \n # Move compose\n if [ -d "$SOURCE_DIR" ]; then\n \tif [ -f docker-compose.yaml ]; then\n \t\tcp docker-compose.yaml "$SOURCE_DIR"/docker-compose.yaml\n \tfi\n \tcd "$SOURCE_DIR"\n fi\n \n docker-compose build\n docker-compose up -d\n """` |Command to execute |
|
||||
|*run.env.COMPOSE_PROJECT_NAME* | `*"source" \| string` |- |
|
||||
|*run.package."docker-compose"* | `true` |- |
|
||||
|*run.registries* | `[]` |Image registries |
|
||||
| Name | Type | Description |
|
||||
| ------------- |:-------------: |:-------------: |
|
||||
|*name* | `*"source" \| string` |App name (use as COMPOSE_PROJECT_NAME) |
|
||||
|*registries* | `[]` |Image registries |
|
||||
|
||||
### compose.#App Outputs
|
||||
|
||||
|
@ -31,11 +31,11 @@ import (
|
||||
}
|
||||
|
||||
// Command to execute
|
||||
command: string @dagger(input)
|
||||
command: string
|
||||
|
||||
// Environment variables shared by all commands
|
||||
env: {
|
||||
[string]: string @dagger(input)
|
||||
[string]: string
|
||||
}
|
||||
|
||||
// Mount content from other artifacts
|
||||
@ -44,17 +44,17 @@ import (
|
||||
from: dagger.#Artifact
|
||||
} | {
|
||||
secret: dagger.#Secret
|
||||
} @dagger(input)
|
||||
}
|
||||
}
|
||||
|
||||
// Mount persistent cache directories
|
||||
cache: {
|
||||
[string]: true @dagger(input)
|
||||
[string]: true
|
||||
}
|
||||
|
||||
// Mount temporary directories
|
||||
tmpfs: {
|
||||
[string]: true @dagger(input)
|
||||
[string]: true
|
||||
}
|
||||
|
||||
// Mount docker socket
|
||||
@ -62,7 +62,7 @@ import (
|
||||
|
||||
// Additional packages to install
|
||||
package: {
|
||||
[string]: true | false | string @dagger(input)
|
||||
[string]: true | false | string
|
||||
}
|
||||
|
||||
// Image registries
|
||||
@ -70,7 +70,7 @@ import (
|
||||
target?: string
|
||||
username: string
|
||||
secret: dagger.#Secret
|
||||
}] @dagger(input)
|
||||
}]
|
||||
|
||||
// Copy contents from other artifacts
|
||||
copy: [string]: from: dagger.#Artifact
|
||||
@ -98,7 +98,7 @@ import (
|
||||
ssh-add /key > /dev/null
|
||||
if [ "$?" != 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ! -z $FINGERPRINT ]]; then
|
||||
@ -131,7 +131,7 @@ import (
|
||||
for registry in registries {
|
||||
op.#Exec & {
|
||||
args: ["/bin/bash", "-c", #"""
|
||||
echo "$TARGER_HOST" | docker login --username "$DOCKER_USERNAME" --password-stdin "$(cat /password)"
|
||||
echo "$TARGER_HOST" | docker login --username "$DOCKER_USERNAME" --password-stdin "$(cat /password)"
|
||||
"""#,
|
||||
]
|
||||
env: {
|
||||
|
Reference in New Issue
Block a user