-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontainers.flow
More file actions
60 lines (57 loc) · 1.78 KB
/
containers.flow
File metadata and controls
60 lines (57 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# yaml-language-server: $schema=https://flowexec.io/schemas/flowfile_schema.json
namespace: docker
description: |
Container workflow automation using Docker. Covers building images with
configurable tags, running containers locally, pushing to a registry,
and cleaning up unused resources.
tags:
- docker
executables:
- verb: build
description: |
Build a Docker image for the project. Pass an optional image tag as the
first positional argument (defaults to app:latest).
exec:
args:
- envKey: IMAGE_TAG
default: app:latest
pos: 1
required: false
cmd: |
docker build -t "${IMAGE_TAG}" .
echo "Built image: ${IMAGE_TAG}"
- verb: run
description: Run the application container and forward a configurable port.
exec:
params:
- envKey: IMAGE_TAG
text: app:latest
- envKey: PORT
text: "8089"
cmd: |
docker run --rm -p "${PORT}:${PORT}" "${IMAGE_TAG}"
- verb: push
aliases: [publish]
description: |
Build, tag, and push the image to a container registry. Prompts for the
registry URL and image tag before starting.
serial:
failFast: true
execs:
- ref: "build flow-examples/docker:"
- cmd: |
docker tag app:latest "${REGISTRY}/app:${TAG}"
docker push "${REGISTRY}/app:${TAG}"
echo "Pushed ${REGISTRY}/app:${TAG}"
params:
- envKey: REGISTRY
prompt: Registry URL (e.g. ghcr.io/myorg)
- envKey: TAG
prompt: Image tag (e.g. v1.0.0)
- verb: clean
aliases: [prune]
description: Remove stopped containers, dangling images, and unused build cache.
exec:
cmd: |
docker system prune -f
echo "Docker resources cleaned"