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

Commit 8f70d8e

Browse files
committed
Add CNAB support
Signed-off-by: Christopher Crone <[email protected]>
1 parent 4b3bef0 commit 8f70d8e

File tree

540 files changed

+28079
-12374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

540 files changed

+28079
-12374
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
_build/
77
bin/
88
!examples/simple/*.dockerapp
9-
!e2e/**/*.dockerapp
9+
!**/testdata/**/*.dockerapp
1010
.gradle
1111
coverage.html
1212
cover.out
13+
**/bundle.json

BUILDING.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ end you need to have `GOPATH` set in your environment.
3030

3131
At this point you can use `go` to checkout `docker-app` in your `GOPATH`:
3232

33-
```console
33+
```sh
3434
go get github.com/docker/app
3535
```
3636

@@ -39,14 +39,14 @@ You are ready to build `docker-app` yourself!
3939
`docker-app` uses `make` to create a repeatable build flow. It means that you
4040
can run:
4141

42-
```console
42+
```sh
4343
make
4444
```
4545

4646
This is going to build all the project binaries in the `./bin/`
4747
directory, run tests (unit and end-to-end).
4848

49-
```console
49+
```sh
5050
make bin/docker-app # builds the docker-app binary
5151
make bin/docker-app-darwin # builds the docker-app binary for darwin
5252
make bin/docker-app-windows.exe # builds the docker-app binary for windows
@@ -59,16 +59,6 @@ make test-e2e # run the end-to-end tests
5959
Vendoring of external imports uses the [`dep`](https://github.com/golang/dep) tool.
6060
Please refer to its documentation if you need to update a dependency.
6161

62-
### Experimental
63-
64-
Just add the `EXPERIMENTAL=on` flag before invoking a build target:
65-
```console
66-
$ make EXPERIMEMTAL=on bin/docker-app
67-
$ ./bin/docker-app version
68-
...
69-
Experimental: on
70-
```
71-
7262
## Build using Docker
7363

7464
If you don't have Go installed but Docker is present, you can also use
@@ -99,7 +89,7 @@ capabilities without using the `Makefile` targets. The following
9989
examples show how to specify a test name and also how to use the flag
10090
directly against `go test` to run root-requiring tests.
10191

102-
```console
92+
```sh
10393
# run the test <TEST_NAME>:
10494
go test -v -run "<TEST_NAME>" .
10595
```

Dockerfile

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ RUN apk add --no-cache \
1010
git \
1111
curl \
1212
util-linux \
13-
coreutils
13+
coreutils \
14+
build-base
1415
RUN curl -Ls https://download.docker.com/linux/static/$DOCKERCLI_CHANNEL/x86_64/docker-$DOCKERCLI_VERSION.tgz | \
1516
tar -xz docker/docker && \
1617
mv docker/docker /usr/bin/docker
1718

1819
WORKDIR /go/src/github.com/docker/app/
1920

21+
# main dev image
2022
FROM build AS dev
2123
ENV PATH=${PATH}:/go/src/github.com/docker/app/bin/
2224
ARG DEP_VERSION=v0.5.0
@@ -26,14 +28,39 @@ RUN go get -d gopkg.in/mjibson/esc.v0 && \
2628
cd /go/src/github.com/mjibson/esc && \
2729
go build -v -o /usr/bin/esc . && \
2830
rm -rf /go/src/* /go/pkg/* /go/bin/*
31+
COPY vendor/github.com/deis/duffle /go/src/github.com/deis/duffle
32+
# Build duffle and init
33+
RUN (cd /go/src/github.com/deis/duffle && \
34+
make bootstrap build-release && \
35+
./bin/duffle-linux-amd64 init)
2936
COPY . .
3037

3138
# FIXME(vdemeester) change from docker-app to dev once buildkit is merged in moby/docker
3239
FROM dev AS cross
3340
ARG EXPERIMENTAL="off"
34-
RUN make EXPERIMENTAL=${EXPERIMENTAL} cross
41+
ARG TAG
42+
ARG COMMIT
43+
RUN make EXPERIMENTAL=${EXPERIMENTAL} TAG=${TAG} COMMIT=${COMMIT} cross
3544

3645
# FIXME(vdemeester) change from docker-app to dev once buildkit is merged in moby/docker
3746
FROM cross AS e2e-cross
3847
ARG EXPERIMENTAL="off"
39-
RUN make EXPERIMENTAL=${EXPERIMENTAL} e2e-cross
48+
# Run e2e tests
49+
ARG TAG
50+
ARG COMMIT
51+
RUN make EXPERIMENTAL=${EXPERIMENTAL} TAG=${TAG} COMMIT=${COMMIT} e2e-cross
52+
53+
# builder of invocation image entrypoint
54+
FROM build AS invocation-build
55+
COPY . .
56+
ARG EXPERIMENTAL="off"
57+
ARG TAG
58+
ARG COMMIT
59+
RUN make EXPERIMENTAL=${EXPERIMENTAL} TAG=${TAG} COMMIT=${COMMIT} bin/run
60+
61+
# cnab invocation image
62+
FROM alpine:${ALPINE_VERSION} AS invocation
63+
RUN apk add --no-cache ca-certificates
64+
COPY --from=invocation-build /go/src/github.com/docker/app/bin/run /cnab/app/run
65+
WORKDIR /cnab/app
66+
CMD /cnab/app/run

0 commit comments

Comments
 (0)