2021-06-17 17:12:51 +02:00
|
|
|
---
|
|
|
|
sidebar_label: docker
|
|
|
|
---
|
|
|
|
|
2021-06-25 13:39:30 +02:00
|
|
|
# alpha.dagger.io/docker
|
2021-06-17 17:12:51 +02:00
|
|
|
|
|
|
|
Docker container operations
|
|
|
|
|
|
|
|
```cue
|
2021-06-25 13:39:30 +02:00
|
|
|
import "alpha.dagger.io/docker"
|
2021-06-17 17:12:51 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
## docker.#Build
|
|
|
|
|
2021-09-14 09:54:09 +02:00
|
|
|
Build a Docker image from source
|
2021-06-17 17:12:51 +02:00
|
|
|
|
|
|
|
### docker.#Build Inputs
|
|
|
|
|
2021-09-14 09:54:09 +02:00
|
|
|
| Name | Type | Description |
|
|
|
|
| ------------- |:-------------: |:-------------: |
|
|
|
|
|*source* | `dagger.#Artifact` |Build context |
|
|
|
|
|*dockerfile* | `*null \| string` |Dockerfile passed as a string |
|
2021-06-17 17:12:51 +02:00
|
|
|
|
|
|
|
### docker.#Build Outputs
|
|
|
|
|
|
|
|
_No output._
|
|
|
|
|
|
|
|
## docker.#Command
|
|
|
|
|
|
|
|
A container image that can run any docker command
|
|
|
|
|
|
|
|
### docker.#Command Inputs
|
|
|
|
|
|
|
|
| Name | Type | Description |
|
|
|
|
| ------------- |:-------------: |:-------------: |
|
|
|
|
|*command* | `string` |Command to execute |
|
|
|
|
|*registries* | `[]` |Image registries |
|
|
|
|
|
|
|
|
### docker.#Command Outputs
|
|
|
|
|
|
|
|
_No output._
|
|
|
|
|
|
|
|
## docker.#Pull
|
|
|
|
|
|
|
|
Pull a docker container
|
|
|
|
|
|
|
|
### docker.#Pull Inputs
|
|
|
|
|
|
|
|
| Name | Type | Description |
|
|
|
|
| ------------- |:-------------: |:-------------: |
|
|
|
|
|*from* | `string` |Remote ref (example: "index.docker.io/alpine:latest") |
|
|
|
|
|
|
|
|
### docker.#Pull Outputs
|
|
|
|
|
|
|
|
_No output._
|
|
|
|
|
|
|
|
## docker.#Push
|
|
|
|
|
2021-06-12 17:11:41 +02:00
|
|
|
Push a docker image to a remote registry
|
2021-06-17 17:12:51 +02:00
|
|
|
|
|
|
|
### docker.#Push Inputs
|
|
|
|
|
2021-07-02 01:20:20 +02:00
|
|
|
| Name | Type | Description |
|
|
|
|
| ------------- |:-------------: |:-------------: |
|
|
|
|
|*target* | `string` |Remote target (example: "index.docker.io/alpine:latest") |
|
|
|
|
|*source* | `dagger.#Artifact` |Image source |
|
2021-06-17 17:12:51 +02:00
|
|
|
|
|
|
|
### docker.#Push Outputs
|
|
|
|
|
2021-06-12 17:11:27 +02:00
|
|
|
| Name | Type | Description |
|
|
|
|
| ------------- |:-------------: |:-------------: |
|
2021-06-12 17:11:41 +02:00
|
|
|
|*ref* | `string` |Image ref |
|
|
|
|
|*digest* | `string` |Image digest |
|
2021-06-17 17:12:51 +02:00
|
|
|
|
|
|
|
## docker.#Run
|
|
|
|
|
|
|
|
### docker.#Run Inputs
|
|
|
|
|
2021-09-22 02:34:51 +02:00
|
|
|
| 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 docker container run -d $OPTS "$IMAGE_REF"\n """` |Command to execute |
|
|
|
|
|*run.env.IMAGE_REF* | `string` |- |
|
|
|
|
|*run.registries* | `[]` |Image registries |
|
2021-06-17 17:12:51 +02:00
|
|
|
|
|
|
|
### docker.#Run Outputs
|
|
|
|
|
|
|
|
_No output._
|