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

Commit bf8ecad

Browse files
authored
Merge pull request #437 from silvin-lubecki/remove-commands
Remove Helm and Fork commands
2 parents 20ebb61 + 9561bf4 commit bf8ecad

29 files changed

Lines changed: 19 additions & 2686 deletions

File tree

README.md

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -160,26 +160,6 @@ cp docker-app-linux /usr/local/bin/docker-app
160160

161161
**Note:** To use Application Packages as images (i.e.: `save`, `push`, or `deploy` when package is not present locally) on Windows, one must be in Linux container mode.
162162

163-
## Integrating with Helm
164-
165-
`docker-app` comes with a few other helpful commands as well, in particular the ability to create Helm Charts from your Docker Applications. This can be useful if you're adopting Kubernetes, and standardising on Helm to manage the lifecycle of your application components, but want to maintain the simplicity of Compose when writing you applications. This also makes it easy to run the same applications locally just using Docker, if you don't want to be running a full Kubernetes cluster.
166-
167-
```
168-
$ docker-app helm
169-
```
170-
171-
This will create a folder, `<my-application-name>.chart`, in the current directory. The folder contains the required `Chart.yaml` file and templates describing the `stack` Kubernetes object based on the Compose file in your application.
172-
173-
_Note that this requires the Compose Kubernetes controller available in Docker for Windows and Docker for Mac, and in Docker Enterprise Edition._
174-
175-
### Helm chart for Docker EE 2.0
176-
177-
In order to create a helm chart that is compatible with version 2.0 of Docker Enterprise Edition, you will need to use the `--stack-version` flag to create a compatible version of the helm chart using `v1beta1` like so:
178-
179-
```bash
180-
$ docker-app helm --stack-version=v1beta1
181-
```
182-
183163
## Single file or directory representation
184164

185165
If you prefer having the three core documents in separate YAML files, omit the `-s` / `--single-file` option to
@@ -213,22 +193,6 @@ All `docker-app` commands accept an image name as input, which means you can run
213193
$ docker-app inspect myhubuser/hello
214194
```
215195

216-
## Forking an existing image
217-
218-
Found an app on a remote registry you'd like to modify to better suit your needs? Use the `fork` subcommand:
219-
220-
```bash
221-
$ docker-app fork remote/hello.dockerapp:1.0.0 mine/hello2 -m "Bob Dylan:bob@aol.com"
222-
```
223-
224-
This command will create a local, editable copy of the app on your system. By default, the copy is created inside the current directory; you may use the `--path` flag to configure a different destination.
225-
226-
For example, the following will create the `/opt/myapps/hello2.dockerapp` folder containing the forked app's files:
227-
228-
```bash
229-
$ docker-app fork remote/hello.dockerapp:1.0.0 mine/hello2 --path /opt/myapps
230-
```
231-
232196
## Next steps
233197

234198
We have lots of ideas for making Compose-based applications easier to share and reuse, and making applications a first-class part of the Docker toolchain. Please let us know what you think about this initial release and about any of the ideas below:
@@ -264,8 +228,6 @@ Options:
264228
Commands:
265229
completion Generates completion scripts for the specified shell (bash or zsh)
266230
deploy Deploy or update an application
267-
fork Create a fork of an existing application to be modified
268-
helm Generate a Helm chart
269231
init Start building a Docker application
270232
inspect Shows metadata, settings and a summary of the compose file for a given application
271233
merge Merge a multi-file application into a single file

cmd/docker-app/fork.go

Lines changed: 0 additions & 31 deletions
This file was deleted.

cmd/docker-app/helm.go

Lines changed: 0 additions & 56 deletions
This file was deleted.

cmd/docker-app/root.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ func newRootCmd(dockerCli *command.DockerCli) *cobra.Command {
4444
func addCommands(cmd *cobra.Command, dockerCli command.Cli) {
4545
cmd.AddCommand(
4646
deployCmd(dockerCli),
47-
forkCmd(),
48-
helmCmd(),
4947
initCmd(),
5048
inspectCmd(dockerCli),
5149
mergeCmd(dockerCli),

e2e/commands_test.go

Lines changed: 19 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func testRenderApp(appPath string, env ...string) func(*testing.T) {
7878
}
7979

8080
func TestRenderFormatters(t *testing.T) {
81-
appPath := filepath.Join("testdata", "fork", "simple.dockerapp")
81+
appPath := filepath.Join("testdata", "simple", "simple.dockerapp")
8282
result := icmd.RunCommand(dockerApp, "render", "--formatter", "json", appPath).Assert(t, icmd.Success)
8383
assert.Assert(t, golden.String(result.Stdout(), "expected-json-render.golden"))
8484

@@ -157,7 +157,7 @@ maintainers:
157157
func TestDetectApp(t *testing.T) {
158158
// cwd = e2e
159159
dir := fs.NewDir(t, "detect-app-binary",
160-
fs.WithDir("helm.dockerapp", fs.FromDir("testdata/helm.dockerapp")),
160+
fs.WithDir("attachments.dockerapp", fs.FromDir("testdata/attachments.dockerapp")),
161161
fs.WithDir("render",
162162
fs.WithDir("app1.dockerapp", fs.FromDir("testdata/render/envvariables/my.dockerapp")),
163163
fs.WithDir("app2.dockerapp", fs.FromDir("testdata/render/envvariables/my.dockerapp")),
@@ -170,11 +170,11 @@ func TestDetectApp(t *testing.T) {
170170
}).Assert(t, icmd.Success)
171171
icmd.RunCmd(icmd.Cmd{
172172
Command: []string{dockerApp, "inspect"},
173-
Dir: dir.Join("helm.dockerapp"),
173+
Dir: dir.Join("attachments.dockerapp"),
174174
}).Assert(t, icmd.Success)
175175
icmd.RunCmd(icmd.Cmd{
176176
Command: []string{dockerApp, "inspect", "."},
177-
Dir: dir.Join("helm.dockerapp"),
177+
Dir: dir.Join("attachments.dockerapp"),
178178
}).Assert(t, icmd.Success)
179179
result := icmd.RunCmd(icmd.Cmd{
180180
Command: []string{dockerApp, "inspect"},
@@ -191,20 +191,14 @@ func TestPack(t *testing.T) {
191191
tempDir, err := ioutil.TempDir("", "dockerapp")
192192
assert.NilError(t, err)
193193
defer os.RemoveAll(tempDir)
194-
icmd.RunCommand(dockerApp, "pack", "testdata/helm", "-o", filepath.Join(tempDir, "test.dockerapp")).Assert(t, icmd.Success)
194+
icmd.RunCommand(dockerApp, "pack", "testdata/attachments", "-o", filepath.Join(tempDir, "test.dockerapp")).Assert(t, icmd.Success)
195195
// check that our commands run on the packed version
196196
icmd.RunCommand(dockerApp, "inspect", filepath.Join(tempDir, "test")).Assert(t, icmd.Expected{
197197
Out: "myapp",
198198
})
199199
icmd.RunCommand(dockerApp, "render", filepath.Join(tempDir, "test")).Assert(t, icmd.Expected{
200200
Out: "nginx",
201201
})
202-
icmd.RunCmd(icmd.Cmd{
203-
Command: []string{dockerApp, "helm", "test"},
204-
Dir: tempDir,
205-
}).Assert(t, icmd.Success)
206-
_, err = os.Stat(filepath.Join(tempDir, "test.chart", "Chart.yaml"))
207-
assert.NilError(t, err)
208202
assert.NilError(t, os.Mkdir(filepath.Join(tempDir, "output"), 0755))
209203
icmd.RunCmd(icmd.Cmd{
210204
Command: []string{dockerApp, "unpack", "test", "-o", "output"},
@@ -214,41 +208,6 @@ func TestPack(t *testing.T) {
214208
assert.NilError(t, err)
215209
}
216210

217-
func TestHelm(t *testing.T) {
218-
t.Run("default", testHelm(""))
219-
t.Run("v1beta1", testHelm("v1beta1"))
220-
t.Run("v1beta2", testHelm("v1beta2"))
221-
}
222-
223-
func testHelm(version string) func(*testing.T) {
224-
return func(t *testing.T) {
225-
dir := fs.NewDir(t, "testHelmBinary", fs.FromDir("testdata"))
226-
defer dir.Remove()
227-
cmd := []string{dockerApp, "helm", "helm", "-s", "myapp.nginx_version=2"}
228-
if version != "" {
229-
cmd = append(cmd, "--stack-version", version)
230-
}
231-
icmd.RunCmd(icmd.Cmd{
232-
Command: cmd,
233-
Dir: dir.Path(),
234-
}).Assert(t, icmd.Success)
235-
236-
chart := golden.Get(t, dir.Join("helm.chart/Chart.yaml"))
237-
values := golden.Get(t, dir.Join("helm.chart/values.yaml"))
238-
stack := golden.Get(t, dir.Join("helm.chart/templates/stack.yaml"))
239-
assert.Check(t, golden.String(string(chart), "helm-expected.chart/Chart.yaml"))
240-
assert.Check(t, golden.String(string(values), "helm-expected.chart/values.yaml"))
241-
assert.Check(t, golden.String(string(stack), "helm-expected.chart/templates/stack"+version+".yaml"))
242-
}
243-
}
244-
245-
func TestHelmInvalidStackVersion(t *testing.T) {
246-
icmd.RunCommand(dockerApp, "helm", "testdata/helm", "--stack-version", "foobar").Assert(t, icmd.Expected{
247-
ExitCode: 1,
248-
Err: `Error: invalid stack version "foobar" (accepted values: v1beta1, v1beta2)`,
249-
})
250-
}
251-
252211
func TestSplitMerge(t *testing.T) {
253212
icmd.RunCommand(dockerApp, "merge", "testdata/render/envvariables/my.dockerapp", "-o", "remerged.dockerapp").Assert(t, icmd.Success)
254213
defer os.Remove("remerged.dockerapp")
@@ -275,47 +234,21 @@ func TestWithRegistry(t *testing.T) {
275234
r := startRegistry(t)
276235
defer r.Stop(t)
277236
registry := r.GetAddress(t)
278-
t.Run("image", testImage(registry))
279-
t.Run("fork", testFork(registry))
280-
}
281-
282-
func testImage(registry string) func(*testing.T) {
283-
return func(t *testing.T) {
284-
// push to a registry
285-
icmd.RunCommand(dockerApp, "push", "--namespace", registry+"/myuser", "testdata/render/envvariables/my.dockerapp").Assert(t, icmd.Success)
286-
icmd.RunCommand(dockerApp, "push", "--namespace", registry+"/myuser", "-t", "latest", "testdata/render/envvariables/my.dockerapp").Assert(t, icmd.Success)
287-
icmd.RunCommand(dockerApp, "inspect", registry+"/myuser/my.dockerapp:0.1.0").Assert(t, icmd.Success)
288-
icmd.RunCommand(dockerApp, "inspect", registry+"/myuser/my.dockerapp").Assert(t, icmd.Success)
289-
icmd.RunCommand(dockerApp, "inspect", registry+"/myuser/my").Assert(t, icmd.Success)
290-
icmd.RunCommand(dockerApp, "inspect", registry+"/myuser/my:0.1.0").Assert(t, icmd.Success)
291-
// push a single-file app to a registry
292-
dir := fs.NewDir(t, "save-prepare-build", fs.WithFile("my.dockerapp", singleFileApp))
293-
defer dir.Remove()
294-
icmd.RunCommand(dockerApp, "push", "--namespace", registry+"/myuser", dir.Join("my.dockerapp")).Assert(t, icmd.Success)
295-
296-
// push with custom repo name
297-
icmd.RunCommand(dockerApp, "push", "-t", "marshmallows", "--namespace", registry+"/rainbows", "--repo", "unicorns", "testdata/render/envvariables/my.dockerapp").Assert(t, icmd.Success)
298-
icmd.RunCommand(dockerApp, "inspect", registry+"/rainbows/unicorns:marshmallows").Assert(t, icmd.Success)
299-
}
300-
}
301-
302-
func testFork(registry string) func(*testing.T) {
303-
return func(t *testing.T) {
304-
icmd.RunCommand(dockerApp, "push", "--namespace", registry+"/acmecorp", "testdata/fork/simple").Assert(t, icmd.Success)
305-
306-
tempDir := fs.NewDir(t, "dockerapptest")
307-
defer tempDir.Remove()
308-
309-
icmd.RunCommand(dockerApp, "fork", registry+"/acmecorp/simple.dockerapp:1.1.0-beta1", "acmecorp/scarlet.devil",
310-
"-p", tempDir.Path(), "-m", "Remilia Scarlet:remilia@acmecorp.cool").Assert(t, icmd.Success)
311-
metadata := golden.Get(t, tempDir.Join("scarlet.devil.dockerapp", "metadata.yml"))
312-
assert.Assert(t, golden.Bytes(metadata, "expected-fork-metadata.golden"))
237+
// push to a registry
238+
icmd.RunCommand(dockerApp, "push", "--namespace", registry+"/myuser", "testdata/render/envvariables/my.dockerapp").Assert(t, icmd.Success)
239+
icmd.RunCommand(dockerApp, "push", "--namespace", registry+"/myuser", "-t", "latest", "testdata/render/envvariables/my.dockerapp").Assert(t, icmd.Success)
240+
icmd.RunCommand(dockerApp, "inspect", registry+"/myuser/my.dockerapp:0.1.0").Assert(t, icmd.Success)
241+
icmd.RunCommand(dockerApp, "inspect", registry+"/myuser/my.dockerapp").Assert(t, icmd.Success)
242+
icmd.RunCommand(dockerApp, "inspect", registry+"/myuser/my").Assert(t, icmd.Success)
243+
icmd.RunCommand(dockerApp, "inspect", registry+"/myuser/my:0.1.0").Assert(t, icmd.Success)
244+
// push a single-file app to a registry
245+
dir := fs.NewDir(t, "save-prepare-build", fs.WithFile("my.dockerapp", singleFileApp))
246+
defer dir.Remove()
247+
icmd.RunCommand(dockerApp, "push", "--namespace", registry+"/myuser", dir.Join("my.dockerapp")).Assert(t, icmd.Success)
313248

314-
icmd.RunCommand(dockerApp, "fork", registry+"/acmecorp/simple.dockerapp:1.1.0-beta1",
315-
"-p", tempDir.Path(), "-m", "Remilia Scarlet:remilia@acmecorp.cool").Assert(t, icmd.Success)
316-
metadata2 := golden.Get(t, tempDir.Join("simple.dockerapp", "metadata.yml"))
317-
assert.Assert(t, golden.Bytes(metadata2, "expected-fork-metadata-no-rename.golden"))
318-
}
249+
// push with custom repo name
250+
icmd.RunCommand(dockerApp, "push", "-t", "marshmallows", "--namespace", registry+"/rainbows", "--repo", "unicorns", "testdata/render/envvariables/my.dockerapp").Assert(t, icmd.Success)
251+
icmd.RunCommand(dockerApp, "inspect", registry+"/rainbows/unicorns:marshmallows").Assert(t, icmd.Success)
319252
}
320253

321254
func TestAttachmentsWithRegistry(t *testing.T) {
@@ -339,16 +272,4 @@ func TestAttachmentsWithRegistry(t *testing.T) {
339272
assert.Assert(t, strings.Contains(resultOutput, "config.cfg"))
340273
assert.Assert(t, strings.Contains(resultOutput, "nesteddir/config2.cfg"))
341274
assert.Assert(t, strings.Contains(resultOutput, "nesteddir/nested2/nested3/config3.cfg"))
342-
343-
// Test forking with external files
344-
tempDir := fs.NewDir(t, "dockerapptest")
345-
defer tempDir.Remove()
346-
347-
icmd.RunCommand(dockerApp, "fork", registry+"/acmecorp/attachments.dockerapp:0.1.0",
348-
"-p", tempDir.Path()).Assert(t, icmd.Success)
349-
externalFile := golden.Get(t, tempDir.Join("attachments.dockerapp", "config.cfg"))
350-
assert.Assert(t, golden.Bytes(externalFile, filepath.Join("attachments.dockerapp", "config.cfg")))
351-
352-
nestedAttachment := golden.Get(t, tempDir.Join("attachments.dockerapp", "nesteddir", "config2.cfg"))
353-
assert.Assert(t, golden.Bytes(nestedAttachment, filepath.Join("attachments.dockerapp", "nesteddir", "config2.cfg")))
354275
}

e2e/testdata/expected-fork-metadata-no-rename.golden

Lines changed: 0 additions & 16 deletions
This file was deleted.

e2e/testdata/expected-fork-metadata.golden

Lines changed: 0 additions & 16 deletions
This file was deleted.

e2e/testdata/helm-expected.chart/Chart.yaml

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)