Skip to content

Commit 0120382

Browse files
committed
feat: simple version of docker runx decorate
Allow to attach a RunX config file to an image or an index. docker runx decorate IMAGE --tag DEST --with-config CONFIG_FILE Signed-off-by: Yves Brissaud <[email protected]>
1 parent b51bafe commit 0120382

File tree

14 files changed

+364
-12
lines changed

14 files changed

+364
-12
lines changed

.golangci.yml

-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ linters:
99
- typecheck
1010
- unused
1111
- unconvert
12-
- gofmt
1312
- misspell
1413
- bodyclose
1514
- revive
1615
- gocyclo
1716
- whitespace
18-
- goimports
1917
- unparam
2018
linters-settings:
2119
gosimple:

docs/reference/docker_runx.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ usage: docker runx [command]
55
pname: docker
66
plink: docker.yaml
77
cname:
8+
- docker runx decorate
89
- docker runx help
910
- docker runx version
1011
clink:
12+
- docker_runx_decorate.yaml
1113
- docker_runx_help.yaml
1214
- docker_runx_version.yaml
1315
deprecated: false
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
command: docker runx decorate
2+
short: Decorate an image by attaching a runx manifest
3+
long: Decorate an image by attaching a runx manifest
4+
usage: docker runx decorate OPTIONS IMAGE
5+
pname: docker runx
6+
plink: docker_runx.yaml
7+
options:
8+
- option: tag
9+
shorthand: t
10+
value_type: string
11+
description: Tag to push the decorated image to
12+
deprecated: false
13+
hidden: false
14+
experimental: false
15+
experimentalcli: false
16+
kubernetes: false
17+
swarm: false
18+
- option: with-config
19+
value_type: string
20+
default_value: runx.yaml
21+
description: Path to the runx manifest file
22+
deprecated: false
23+
hidden: false
24+
experimental: false
25+
experimentalcli: false
26+
kubernetes: false
27+
swarm: false
28+
deprecated: false
29+
hidden: false
30+
experimental: false
31+
experimentalcli: false
32+
kubernetes: false
33+
swarm: false
34+

docs/reference/runx.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ Docker Run, better
55

66
### Subcommands
77

8-
| Name | Description |
9-
|:-----------------------------|:-------------------------------------------------|
10-
| [`help`](runx_help.md) | Display information about the available commands |
11-
| [`version`](runx_version.md) | Show Docker RunX version information |
8+
| Name | Description |
9+
|:-------------------------------|:-------------------------------------------------|
10+
| [`decorate`](runx_decorate.md) | Decorate an image by attaching a runx manifest |
11+
| [`help`](runx_help.md) | Display information about the available commands |
12+
| [`version`](runx_version.md) | Show Docker RunX version information |
1213

1314

1415

docs/reference/runx_decorate.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# docker runx decorate
2+
3+
<!---MARKER_GEN_START-->
4+
Decorate an image by attaching a runx manifest
5+
6+
### Options
7+
8+
| Name | Type | Default | Description |
9+
|:----------------|:---------|:------------|:-----------------------------------|
10+
| `-t`, `--tag` | `string` | | Tag to push the decorated image to |
11+
| `--with-config` | `string` | `runx.yaml` | Path to the runx manifest file |
12+
13+
14+
<!---MARKER_GEN_END-->
15+

examples/alpine-hello.runx.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
actions:
2+
- id: hello
3+
type: run
4+
cmds: --rm {{.Ref}} echo hello

go.mod

+12-1
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,22 @@ module github.com/eunomie/docker-runx
33
go 1.23.1
44

55
require (
6+
github.com/briandowns/spinner v1.23.1
67
github.com/docker/cli v27.3.1+incompatible
78
github.com/docker/cli-docs-tool v0.8.0
9+
github.com/google/go-containerregistry v0.20.2
810
github.com/spf13/cobra v1.8.1
911
github.com/spf13/pflag v1.0.5
1012
)
1113

1214
require (
1315
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
14-
github.com/Microsoft/go-winio v0.4.14 // indirect
16+
github.com/Microsoft/go-winio v0.6.1 // indirect
1517
github.com/beorn7/perks v1.0.1 // indirect
1618
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
1719
github.com/cespare/xxhash/v2 v2.3.0 // indirect
1820
github.com/containerd/log v0.1.0 // indirect
21+
github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect
1922
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
2023
github.com/distribution/reference v0.6.0 // indirect
2124
github.com/docker/distribution v2.8.3+incompatible // indirect
@@ -25,6 +28,7 @@ require (
2528
github.com/docker/go-connections v0.5.0 // indirect
2629
github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916 // indirect
2730
github.com/docker/go-units v0.5.0 // indirect
31+
github.com/fatih/color v1.7.0 // indirect
2832
github.com/felixge/httpsnoop v1.0.4 // indirect
2933
github.com/fvbommel/sortorder v1.1.0 // indirect
3034
github.com/go-logr/logr v1.4.2 // indirect
@@ -34,8 +38,12 @@ require (
3438
github.com/gorilla/mux v1.7.0 // indirect
3539
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect
3640
github.com/inconshreveable/mousetrap v1.1.0 // indirect
41+
github.com/klauspost/compress v1.16.5 // indirect
42+
github.com/mattn/go-colorable v0.1.2 // indirect
43+
github.com/mattn/go-isatty v0.0.8 // indirect
3744
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
3845
github.com/miekg/pkcs11 v1.0.2 // indirect
46+
github.com/mitchellh/go-homedir v1.1.0 // indirect
3947
github.com/moby/docker-image-spec v1.3.1 // indirect
4048
github.com/moby/sys/sequential v0.6.0 // indirect
4149
github.com/moby/term v0.5.0 // indirect
@@ -50,6 +58,7 @@ require (
5058
github.com/russross/blackfriday/v2 v2.1.0 // indirect
5159
github.com/sirupsen/logrus v1.9.3 // indirect
5260
github.com/theupdateframework/notary v0.7.0 // indirect
61+
github.com/vbatts/tar-split v0.11.3 // indirect
5362
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect
5463
go.opentelemetry.io/otel v1.21.0 // indirect
5564
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.44.0 // indirect
@@ -62,12 +71,14 @@ require (
6271
go.opentelemetry.io/otel/trace v1.21.0 // indirect
6372
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
6473
golang.org/x/crypto v0.27.0 // indirect
74+
golang.org/x/mod v0.17.0 // indirect
6575
golang.org/x/net v0.29.0 // indirect
6676
golang.org/x/sync v0.8.0 // indirect
6777
golang.org/x/sys v0.25.0 // indirect
6878
golang.org/x/term v0.24.0 // indirect
6979
golang.org/x/text v0.18.0 // indirect
7080
golang.org/x/time v0.6.0 // indirect
81+
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
7182
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect
7283
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
7384
google.golang.org/grpc v1.66.1 // indirect

0 commit comments

Comments
 (0)