Skip to content
This repository was archived by the owner on Jul 11, 2025. It is now read-only.

Commit d447afc

Browse files
authored
Update everything s/dockersource/gnarly/
Also changes references to cpuguy83 to deislabs.
1 parent 091a3c4 commit d447afc

File tree

4 files changed

+19
-16
lines changed

4 files changed

+19
-16
lines changed

.dockerignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
.gitignore
33
.git
44
Dockerfile
5-
dockersource
5+
gnarly
66
docker
7+
contrib/
8+
bin/

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
dockersource
21
docker
2+
gnarly
3+
bin/

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG GO_VERSION=1.18
22
FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS build
3-
WORKDIR /go/src/github.com/cpuguy83/dockersource
3+
WORKDIR /go/src/github.com/deislabs/gnarly
44
COPY go.mod .
55
COPY go.sum .
66
RUN \
@@ -17,4 +17,4 @@ RUN \
1717
GOARM=${TARGETVARIANT#v} CGO_ENABLED=0 go build .
1818

1919
FROM scratch
20-
COPY --from=build /go/src/github.com/cpuguy83/dockersource/dockersource /
20+
COPY --from=build /go/src/github.com/deislabs/gnarly /

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This tool can output data in two formats:
1919
The default format is `build-flags`.
2020

2121
```console
22-
$ ./dockersource --mod-prog=contrib/mod.sh --mod-config=contrib/lookup.json
22+
$ ./gnarly --mod-prog=contrib/mod.sh --mod-config=contrib/lookup.json
2323
--build-context docker.io/library/golang:1.18=docker-image://mcr.microsoft.com/oss/go/microsoft/golang:1.18 $
2424
```
2525

@@ -30,7 +30,7 @@ When using this format, whatever `--build-args` you pass to this tool will also
3030

3131
With `docker buildx build`:
3232
```console
33-
$ docker buildx build $(./dockersource --mod-prog=contrib/mod.sh --mod-config=contrib/lookup.json) .
33+
$ docker buildx build $(./gnarly --mod-prog=contrib/mod.sh --mod-config=contrib/lookup.json) .
3434
[+] Building 32.0s (12/12) FINISHED
3535
=> [internal] load build definition from Dockerfile 0.0s
3636
=> => transferring dockerfile: 496B 0.0s
@@ -41,21 +41,21 @@ $ docker buildx build $(./dockersource --mod-prog=contrib/mod.sh --mod-config=co
4141
=> => resolve mcr.microsoft.com/oss/go/microsoft/golang:1.18 0.0s
4242
=> [internal] load build context 0.0s
4343
=> => transferring context: 7.03kB 0.0s
44-
=> CACHED [build 1/7] WORKDIR /go/src/github.com/cpuguy83/dockersource 0.0s
44+
=> CACHED [build 1/7] WORKDIR /go/src/github.com/deislabs/gnarly 0.0s
4545
=> CACHED [build 2/7] COPY go.mod . 0.0s
4646
=> CACHED [build 3/7] COPY go.sum . 0.0s
4747
=> CACHED [build 4/7] RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build go mod download 0.0s
4848
=> [build 5/7] COPY . . 0.2s
4949
=> [build 6/7] RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 go build . 31.5s
50-
=> [stage-1 1/1] COPY --from=build /go/src/github.com/cpuguy83/dockersource/dockersource /
50+
=> [stage-1 1/1] COPY --from=build /go/src/github.com/deislabs/gnarly/gnarly /
5151
```
5252

5353

5454

5555
For `--format=modfile`:
5656

5757
```console
58-
$ ./dockersource --format=modfile --mod-prog=contrib/mod.sh --mod-config=contrib/lookup.json | tee Dockerfile.mod
58+
$ ./gnarly --format=modfile --mod-prog=contrib/mod.sh --mod-config=contrib/lookup.json | tee Dockerfile.mod
5959
{
6060
"sources": [
6161
{
@@ -68,9 +68,9 @@ $ ./dockersource --format=modfile --mod-prog=contrib/mod.sh --mod-config=contrib
6868
$ docker buildx build --build-arg BUILDKIT_SYNTAX=mcr.microsoft.com/oss/moby/dockerfile:modfile1 .
6969
```
7070

71-
Here we've told `dockersource` to use `contrib/mod.sh` as a tool to handle replacements.
71+
Here we've told `gnarly` to use `contrib/mod.sh` as a tool to handle replacements.
7272
The `contrib/mod.sh` script uses `contrib/lookup.json` as a lookup table for replacements.
73-
For each ref that is found in the Dockerfile by `dockersource`, the `contrib/mod.sh` is called with the found ref as the first argument. The `contrib/mod.sh` script can return an empty string or a replacement ref.
73+
For each ref that is found in the Dockerfile by `gnarly`, the `contrib/mod.sh` is called with the found ref as the first argument. The `contrib/mod.sh` script can return an empty string or a replacement ref.
7474
You can specify a path to a config file to use, which will be passed along to the mod-prog as an environment variable `MOD_CONFIG`.
7575

7676
The output of this is saved to `Dockerfile.mod` which is a special file that the syntax parser shown above will parse to handle replacements.
@@ -94,7 +94,7 @@ In some cases you may not want to modify the main build context with a Dockerfil
9494

9595
```console
9696
$ dir="$(mktemp -d)" # Make a temp dir where we'll store the Dockerfile.mod
97-
$ ./dockersource --format=modfile --mod-prog=contrib/mod.sh --mod-config=contrib/lookup.json | tee "${dir}/Dockerfile.mod" # Generate the Dockerfile.mod and store it in the temp dir created above.
97+
$ ./gnarly --format=modfile --mod-prog=contrib/mod.sh --mod-config=contrib/lookup.json | tee "${dir}/Dockerfile.mod" # Generate the Dockerfile.mod and store it in the temp dir created above.
9898
{
9999
"sources": [
100100
{
@@ -124,13 +124,13 @@ $ docker buildx build --build-arg BUILDKIT_SYNTAX=mcr.microsoft.com/oss/moby/doc
124124
=> => resolve mcr.microsoft.com/oss/go/microsoft/golang:1.18@sha256:fba12e22cb828665f844f123c5bfd5143f8e9c00c960d6abd4653b1b0e35df6c 0.0s
125125
=> [internal] load build context 0.0s
126126
=> => transferring context: 19.10kB 0.0s
127-
=> CACHED [build 2/7] WORKDIR /go/src/github.com/cpuguy83/dockersource 0.0s
127+
=> CACHED [build 2/7] WORKDIR /go/src/github.com/deislabs/gnarly 0.0s
128128
=> CACHED [build 3/7] COPY go.mod . 0.0s
129129
=> CACHED [build 4/7] COPY go.sum . 0.0s
130130
=> CACHED [build 5/7] RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build go mod download 0.0s
131131
=> [build 6/7] COPY . . 0.2s
132132
=> [build 7/7] RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 go build . 1.2s
133-
=> [stage-1 1/1] COPY --from=build /go/src/github.com/cpuguy83/dockersource/dockersource /
133+
=> [stage-1 1/1] COPY --from=build /go/src/github.com/deislabs/gnarly/gnarly /
134134
$ rm -rf "${dir}"
135135
```
136136

@@ -152,13 +152,13 @@ If so it will auto-generate the replacements and inject the neccessary arguments
152152

153153
This can be done in one of two ways:
154154

155-
1. You can create a symlink (or just call the binary `docker`...) to the `dockersource` binary called `docker`. Any invocation where against this symlink will make it act as a docker wrapper., e.g. `ln -s ln -s ./dockersource docker`
155+
1. You can create a symlink (or just call the binary `docker`...) to the `gnarly` binary called `docker`. Any invocation where against this symlink will make it act as a docker wrapper., e.g. `ln -s ln -s ./gnarly docker`
156156
2. In lieu of symlinking or other such methods, you can set the environment variable `DOCKERFILE_MOD_INVOKE_DOCKER=1`, this has the same affect as 1.
157157

158158
This can completely wrap docker (even `docker run`, `docker exec`, etc).
159159
This should work with 100% of use cases **except** since it is are trying to generate mod data for builds, remote build contexts (e.g. `docker buildx build <URL>`) are not currently supported.
160160
The workaround for this is to pre-generate your mod files and pass the path as an environment variable `DOCKERFILE_MOD_PATH=<path to Dockerfile.mod>`.
161-
This workaround is going to be the best way to make sure no builds fail because of some missing functionality in `dockersource`.
161+
This workaround is going to be the best way to make sure no builds fail because of some missing functionality in `gnarly`.
162162

163163
This will also inject `buildx` into a build invocation if `docker build` does not support the `--build-context` flag.
164164
Example: `docker build .` will be changed to `docker buildx build .`.

0 commit comments

Comments
 (0)