2021-06-09 02:35:42 +02:00
|
|
|
---
|
|
|
|
sidebar_label: docker
|
|
|
|
---
|
|
|
|
|
2021-06-23 16:31:42 +02:00
|
|
|
# alpha.dagger.io/docker
|
2021-06-09 02:35:42 +02:00
|
|
|
|
2021-06-15 10:48:54 +02:00
|
|
|
Docker container operations
|
|
|
|
|
2021-06-16 12:14:39 +02:00
|
|
|
```cue
|
2021-06-23 16:31:42 +02:00
|
|
|
import "alpha.dagger.io/docker"
|
2021-06-16 12:14:39 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
## docker.#Build
|
2021-06-09 02:35:42 +02:00
|
|
|
|
|
|
|
Build a Docker image from source, using included Dockerfile
|
|
|
|
|
2021-06-16 12:14:39 +02:00
|
|
|
### docker.#Build Inputs
|
2021-06-09 02:35:42 +02:00
|
|
|
|
|
|
|
| Name | Type | Description |
|
|
|
|
| ------------- |:-------------: |:-------------: |
|
|
|
|
|*source* | `dagger.#Artifact` |- |
|
|
|
|
|
2021-06-16 12:14:39 +02:00
|
|
|
### docker.#Build Outputs
|
2021-06-09 02:35:42 +02:00
|
|
|
|
|
|
|
_No output._
|
|
|
|
|
2021-06-16 12:14:39 +02:00
|
|
|
## docker.#Command
|
2021-06-09 02:35:42 +02:00
|
|
|
|
2021-06-11 19:01:33 +02:00
|
|
|
A container image that can run any docker command
|
2021-06-09 02:35:42 +02:00
|
|
|
|
2021-06-16 12:14:39 +02:00
|
|
|
### docker.#Command Inputs
|
2021-06-09 02:35:42 +02:00
|
|
|
|
2021-06-11 19:01:33 +02:00
|
|
|
| Name | Type | Description |
|
|
|
|
| ------------- |:-------------: |:-------------: |
|
|
|
|
|*command* | `string` |Command to execute |
|
2021-06-09 02:35:42 +02:00
|
|
|
|
2021-06-16 12:14:39 +02:00
|
|
|
### docker.#Command Outputs
|
2021-06-09 02:35:42 +02:00
|
|
|
|
|
|
|
_No output._
|
|
|
|
|
2021-06-16 12:14:39 +02:00
|
|
|
## docker.#ImageFromDockerfile
|
2021-06-09 02:35:42 +02:00
|
|
|
|
|
|
|
Build a Docker image from the provided Dockerfile contents
|
|
|
|
|
2021-06-16 12:14:39 +02:00
|
|
|
### docker.#ImageFromDockerfile Inputs
|
2021-06-09 02:35:42 +02:00
|
|
|
|
2021-06-15 10:48:54 +02:00
|
|
|
| Name | Type | Description |
|
|
|
|
| ------------- |:-------------: |:-------------: |
|
|
|
|
|*dockerfile* | `string` |Dockerfile passed as a string |
|
|
|
|
|*context* | `dagger.#Artifact` |Build context |
|
2021-06-09 02:35:42 +02:00
|
|
|
|
2021-06-16 12:14:39 +02:00
|
|
|
### docker.#ImageFromDockerfile Outputs
|
2021-06-09 02:35:42 +02:00
|
|
|
|
|
|
|
_No output._
|
|
|
|
|
2021-06-16 12:14:39 +02:00
|
|
|
## docker.#Pull
|
2021-06-09 02:35:42 +02:00
|
|
|
|
|
|
|
Pull a docker container
|
|
|
|
|
2021-06-16 12:14:39 +02:00
|
|
|
### docker.#Pull Inputs
|
2021-06-09 02:35:42 +02:00
|
|
|
|
|
|
|
| Name | Type | Description |
|
|
|
|
| ------------- |:-------------: |:-------------: |
|
|
|
|
|*from* | `string` |Remote ref (example: "index.docker.io/alpine:latest") |
|
|
|
|
|
2021-06-16 12:14:39 +02:00
|
|
|
### docker.#Pull Outputs
|
2021-06-09 02:35:42 +02:00
|
|
|
|
|
|
|
_No output._
|
|
|
|
|
2021-06-16 12:14:39 +02:00
|
|
|
## docker.#Push
|
2021-06-09 02:35:42 +02:00
|
|
|
|
|
|
|
Push a docker image
|
|
|
|
|
2021-06-16 12:14:39 +02:00
|
|
|
### docker.#Push Inputs
|
2021-06-09 02:35:42 +02:00
|
|
|
|
|
|
|
| Name | Type | Description |
|
|
|
|
| ------------- |:-------------: |:-------------: |
|
|
|
|
|*ref* | `string` |Remote ref (example: "index.docker.io/alpine:latest") |
|
|
|
|
|*source* | `dagger.#Artifact` |Image |
|
|
|
|
|
2021-06-16 12:14:39 +02:00
|
|
|
### docker.#Push Outputs
|
2021-06-09 02:35:42 +02:00
|
|
|
|
|
|
|
_No output._
|
|
|
|
|
2021-06-16 12:14:39 +02:00
|
|
|
## docker.#Run
|
2021-06-09 02:35:42 +02:00
|
|
|
|
2021-06-16 12:14:39 +02:00
|
|
|
### docker.#Run Inputs
|
2021-06-09 02:35:42 +02:00
|
|
|
|
2021-06-11 19:01:33 +02:00
|
|
|
| Name | Type | Description |
|
|
|
|
| ------------- |:-------------: |:-------------: |
|
|
|
|
|*ssh.host* | `string` |ssh host |
|
|
|
|
|*ssh.user* | `string` |ssh user |
|
|
|
|
|*ssh.port* | `*22 \| int` |ssh port |
|
|
|
|
|*ssh.key* | `dagger.#Secret` |private key |
|
|
|
|
|*ref* | `string` |Image reference (e.g: nginx:alpine) |
|
|
|
|
|*run.ssh.host* | `string` |ssh host |
|
|
|
|
|*run.ssh.user* | `string` |ssh user |
|
|
|
|
|*run.ssh.port* | `*22 \| int` |ssh port |
|
|
|
|
|*run.ssh.key* | `dagger.#Secret` |private key |
|
|
|
|
|*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 docker container run -d $OPTS "$IMAGE_REF"\n """` |Command to execute |
|
|
|
|
|*run.env.IMAGE_REF* | `string` |- |
|
2021-06-09 02:35:42 +02:00
|
|
|
|
2021-06-16 12:14:39 +02:00
|
|
|
### docker.#Run Outputs
|
2021-06-09 02:35:42 +02:00
|
|
|
|
|
|
|
_No output._
|