2021-02-17 18:53:15 +01:00
|
|
|
# Export image to Docker
|
|
|
|
|
2022-10-07 18:20:56 +02:00
|
|
|
You may want your build result to be available in the Docker client through
|
|
|
|
`docker images` to be able to use it in another step of your workflow:
|
2021-02-17 18:53:15 +01:00
|
|
|
|
|
|
|
```yaml
|
|
|
|
name: ci
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2022-01-18 14:57:27 +01:00
|
|
|
- 'main'
|
2021-02-17 18:53:15 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
docker:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2022-05-28 18:36:30 +02:00
|
|
|
uses: actions/checkout@v3
|
2021-02-17 18:53:15 +01:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2022-05-05 19:24:32 +02:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2021-02-17 18:53:15 +01:00
|
|
|
-
|
|
|
|
name: Build
|
2022-05-05 19:24:32 +02:00
|
|
|
uses: docker/build-push-action@v3
|
2021-02-17 18:53:15 +01:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
load: true
|
|
|
|
tags: myimage:latest
|
|
|
|
-
|
|
|
|
name: Inspect
|
|
|
|
run: |
|
|
|
|
docker image inspect myimage:latest
|
|
|
|
```
|