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

Commit aba83a5

Browse files
Introduce a new run binary, which is the new docker-app CNAB "backend".
In future commits, the docker-app binary will be mutated as a frontend, and all the installation logic will be moved to the run binary. run comes with the 4 CNAB core commands: install/uninstall/status/upgrade. Adds github.com/deislabs/duffle as vendoring Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
1 parent 3603491 commit aba83a5

229 files changed

Lines changed: 20214 additions & 8938 deletions

File tree

Some content is hidden

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

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,11 @@ RUN make EXPERIMENTAL=${EXPERIMENTAL} cross
3737
FROM cross AS e2e-cross
3838
ARG EXPERIMENTAL="off"
3939
RUN make EXPERIMENTAL=${EXPERIMENTAL} e2e-cross
40+
41+
# builder of invocation image entrypoint
42+
FROM build AS invocation-build
43+
COPY . .
44+
ARG EXPERIMENTAL="off"
45+
ARG TAG
46+
ARG COMMIT
47+
RUN make EXPERIMENTAL=${EXPERIMENTAL} TAG=${TAG} COMMIT=${COMMIT} bin/run

Gopkg.lock

Lines changed: 82 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ required = ["github.com/wadey/gocovmerge"]
2929

3030
[[constraint]]
3131
name = "github.com/docker/cli"
32-
branch = "master"
32+
branch = "expose-stack-commands-1500"
33+
source = "github.com/silvin-lubecki/cli"
34+
35+
[[constraint]]
36+
name = "github.com/deis/duffle"
37+
branch = "dockercon-version"
38+
source = "git@github.com:simonferquel/duffle.git"
3339

3440
[[constraint]]
3541
name = "github.com/sirupsen/logrus"

cmd/run/env.go

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package main
2+
3+
import (
4+
"os"
5+
6+
"github.com/docker/cli/cli/command"
7+
cliconfig "github.com/docker/cli/cli/config"
8+
"github.com/docker/cli/cli/context/docker"
9+
kubcontext "github.com/docker/cli/cli/context/kubernetes"
10+
contextstore "github.com/docker/cli/cli/context/store"
11+
cliflags "github.com/docker/cli/cli/flags"
12+
)
13+
14+
const (
15+
envVarOchestrator = "DOCKER_STACK_ORCHESTRATOR"
16+
fileDockerContext = "/cnab/app/context.dockercontext"
17+
)
18+
19+
var storeConfig = contextstore.NewConfig(
20+
func() interface{} { return &command.DockerContext{} },
21+
contextstore.EndpointTypeGetter(docker.DockerEndpoint, func() interface{} { return &docker.EndpointMeta{} }),
22+
contextstore.EndpointTypeGetter(kubcontext.KubernetesEndpoint, func() interface{} { return &kubcontext.EndpointMeta{} }),
23+
)
24+
25+
func setupDockerContext() (command.Cli, error) {
26+
s := contextstore.New(cliconfig.ContextStoreDir(), storeConfig)
27+
f, err := os.Open(fileDockerContext)
28+
if err != nil {
29+
return nil, err
30+
}
31+
defer f.Close()
32+
if err := contextstore.Import("cnab", s, f); err != nil {
33+
return nil, err
34+
}
35+
cli := command.NewDockerCli(os.Stdin, os.Stdout, os.Stderr, false, nil)
36+
return cli, cli.Initialize(&cliflags.ClientOptions{
37+
Common: &cliflags.CommonOptions{
38+
Context: "cnab",
39+
},
40+
})
41+
}

0 commit comments

Comments
 (0)