docker / app Goto Github PK
View Code? Open in Web Editor NEWMake your Docker Compose applications reusable, and share them on Docker Hub
License: Apache License 2.0
Make your Docker Compose applications reusable, and share them on Docker Hub
License: Apache License 2.0
All commands (where it makes sense) are symmetrical:
but with docker-app deploy
you have to change executable docker stack rm <my app>
.
Given the following template
version: '3'
services:
hello:
image: hashicorp/http-echo:${version}
command: ["-text", "${text}"]
ports:
- ${port}:5678
Rendering the template expands the ports definition:
$ docker-app-windows.exe render
version: "3.0"
services:
hello:
command:
- -text
- hello development
image: hashicorp/http-echo:latest
ports:
- mode: ingress
target: 5678
published: 5678
protocol: tcp
Passing this to Compose fails with the following error:
$ docker-app-windows.exe render | docker-compose -f - up
ERROR: The Compose file is invalid because:
services.hello.ports is invalid: Invalid port "{'mode': 'ingress', 'target': 5678, 'published': 5678, 'protocol': 'tcp'}", should be [[remote_ip:]remote_port[-remote_port]:]port[/protocol]
services.hello.ports contains an invalid type, it should be a string, or a number
The long syntax is only supported by Compose v3.2 and above (https://docs.docker.com/compose/compose-file/#short-syntax-1). Changing the version to 3.2
resolves this issue for this particular Compose file, but we want to make this work out of the box for past versions as well.
I think that we shouldn't expand this from how it was authored.
As we're not yet sure what the final extension will be, it would be good to make this configurable.
The extension list can be accessed through Tools
/ Extensions and Updates…
.
The name and description are a bit rough, the icon could be customized eventually.
The information on the right generic, especially the Created by: Company
label.
Some extensions have links to Release Notes
, Getting Started
, etc…
Having comments on each field would be nice.
This can be achieved by either:
Description
The pack/unpack commands are behind the experimental flag but mentioned in the Wordpress example.
Thanks @ajeetraina for spotting this!
Describe the results you expected:
We can replace this with a save
and then docker image save
to save the tarball to disk.
Description
When running commands such as docker-app helm
, bash completion puts a /
at the end of the .dockerapp
folder.
but docker-app
fails if the name of the app ends with /
.
Steps to reproduce the issue:
cd
to the examples folderdocker-app helm voting-app/voting
docker-app helm voting-app/voting-app.dockerapp/
)Describe the results you received:
$ docker-app helm voting-app/voting-app.dockerapp/
Error: failed to read application metadata: open voting-app/voting-app.dockerapp/.dockerapp/metadata.yml: no such file or directory
$
Describe the results you expected:
$ docker-app helm voting-app/voting-app.dockerapp/
$
Output of docker-app version
:
$ docker-app version
Version: v0.2.0-53-gb7527d0
Git commit: b7527d0
Built: Thu Jun 28 14:15:57 2018
OS/Arch: linux/amd64
Experimental: off
Renderers: none
Description
The download link : https://github.com/docker/app/releases/download/v0.1.0/docker-app-linux.tar.gz refers to the old release and is broken
Steps to reproduce the issue:
Describe the results you received:
wget https://github.com/docker/app/releases/download/0.1.0/docker-app-linux.tar.gz
--2018-06-18 09:24:32-- https://github.com/docker/app/releases/download/0.1.0/docker-app-linux.tar.gz
Resolving github.com (github.com)... 192.30.253.112, 192.30.253.113
Connecting to github.com (github.com)|192.30.253.112|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-06-18 09:24:32 ERROR 404: Not Found.
Describe the results you expected:
Download the release binary
$ pwd
/src/github.com/docker/app/examples/hello-world
$ docker-app load
Error: error from docker save command: Error response from daemon: invalid reference format
: exit status 1
error from docker save command: Error response from daemon: invalid reference format
: exit status 1
The current Makefile contains a bunch of local undocumented assumptions which mean it doesn't run on Windows. eg.
test
grep
tar
Some of the CI targets only require Docker, which might be one approach to a go default. Then allow an ENV to push things to run locally when required.
(experimental: off)
You can save and push but not load and pull.
14:37 $ docker-app
Build and deploy Docker applications.
Usage:
docker-app [command]
Available Commands:
deploy Deploy or update an application
helm Generate a Helm chart
help Help about any command
init Start building a Docker application
inspect Shows metadata and settings for a given application
push Push the application to a registry
render Render the Compose file for the application
save Save the application as an image to the docker daemon(in preparation for push)
version Print version information
docker-app version
Version: 0.1.0-162-g9b311d2
Git commit: 9b311d2
Build time: 2018-06-07T12:36:50.253486313+00:00
OS/Arch: linux/amd64
Experimental: off
Renderers: none
Using the following Compsoe file
version: '3.5'
services:
hello:
image: hashicorp/http-echo:${version}
command: ["-text", "${text}"]
ports:
- ${port}:5678
networks:
- backend
When this is rendered note the expansion of the list to include null
.
version: "3.5"
services:
hello:
command:
- -text
- hello world
image: hashicorp/http-echo:latest
networks:
backend: null
ports:
- mode: ingress
target: 5678
published: 8080
protocol: tcp
For file paths we currently use path which description contains
The path package should only be used for paths separated by forward slashes, such as the paths in URLs. This package does not deal with Windows paths with drive letters or backslashes; to manipulate operating system paths, use the path/filepath package.
We should instead use path/filepath, for instance path.Join should be replaced with filepath.Join
In Compose, we can specify multiple compose files by declaring the -f flag multiple times, so that we can combine multiple services together without having to define them into the same compose file:
docker-compose -f app1-compose.yml -f app2-compose.yml up -d
It would be useful to be able to render multiple apps into a single compose file, to support running multiple apps together from one docker-app render command line:
docker-app render app1.dockerapp app2.dockerapp | docker-compose -f - up -d
Render should follow the same rules as compose for declaring multiple compose files (overriding, etc).
To be consistent with other Docker products, we should use logrus
instead of log
.
Currently
docker-app init scratch
gives:
metadata.yml
:
version: 0.1.0
name: scratch
description: ""
maintainers:
- name: root
email: ""
targets:
swarm: true
kubernetes: true
docker-app init scratch --description "An app built from scratch" --maintainer "antony:[email protected]" --maintainer "dimrok:[email protected]"
gives:
metadata.yml
:
version: 0.1.0
name: scratch
description: "An app built from scratch"
maintainers:
- name: antony
email: [email protected]
- name: dimrok
email: [email protected]
targets:
swarm: true
kubernetes: true
make -f docker.Makefile
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
make: *** No rule to make target `bin', needed by `all'. Stop.
Specifically the default target is set to bin test
, but there is no top level bin
target. Looks like cross
might be the relevant target?
$ ls -l
-rw-r--r-- 1 dimrok dimrok 1786 mai 22 14:26 docker-compose.yml
-rw-r--r-- 1 dimrok dimrok 167 mai 22 10:42 metadata.yml
-rw-r--r-- 1 dimrok dimrok 437 mai 22 14:27 settings.yml
$ docker-app push -p dimrok/ -t latest
Error: error from docker push command: invalid reference format
: exit status 1
$ cd ..
$ ls -l
drwxr-xr-x 5 dimrok dimrok 4096 mai 22 15:58 voting-app.dockerapp
$ docker-app push -p dimrok/ -t latest
Error: error from docker push command: invalid reference format
: exit status 1
$ docker-app push -p dimrok/ -t latest voting-app.dockerapp
✔
Right now, docker-app pack
/ docker-app unpack
work like a charm except the output file has no extension.
I'm personally not a huge of files without extensions (unless their name is self-explanatory, like Makefile
).
docker-app pack -o my-app
creates my-app
.
Unpacking gives:
$ docker-app unpack my-app
$ ls -l
my-pack.docker-app/
docker-app pack -o my-app
creates my-app.docker-app-pack
.
Unpacking gives:
$ docker-app unpack my-app.docker-app-pack
$ ls -l
my-app.docker-app
$ docker-app version
Version: fb89420-dirty
Git commit: fb89420
OS/Arch: linux/amd64
Experimental: on
Renderers: gotemplate
A value of false removes the flagged node entirely.
Description
Is there any possibility that docker-app will be able to generate Helm charts that are not dependent on the Compose Kubernetes controller available in Docker for Mac/Windows and Docker EE? Or, will the Helm support always rely on that?
Steps to reproduce the issue:
docker-app helm
.Describe the results you received:
The resource version/type cannot be resolved.
Describe the results you expected:
The Helm chart is installed.
Additional information you deem important (e.g. issue happens only occasionally):
This limitation is noted in the README file.
Note that this requires the Compose Kubernetes controller available in Docker for Windows and Docker for Mac, and in Docker Enterprise Edition.
Output of docker version
:
Client:
Version: 18.05.0-ce
API version: 1.37
Go version: go1.9.5
Git commit: f150324
Built: Wed May 9 22:12:05 2018
OS/Arch: darwin/amd64
Experimental: true
Orchestrator: swarm
Server:
Engine:
Version: 18.05.0-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.10.1
Git commit: f150324
Built: Wed May 9 22:20:16 2018
OS/Arch: linux/amd64
Experimental: true
Output of docker-app version
:
Version: v0.2.0
Git commit: 854872f
Build time: 2018-06-11T15:06:17.093522032+00:00
OS/Arch: darwin/amd64
Experimental: off
Renderers: none
Output of docker info
:
Containers: 54
Running: 22
Paused: 0
Stopped: 32
Images: 154
Server Version: 18.05.0-ce
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: active
NodeID: w97q3z0azzcv970g3e5hn9ski
Is Manager: true
ClusterID: o1cdcrn2etmq3kcz2aapse3n4
Managers: 1
Nodes: 1
Orchestration:
Task History Retention Limit: 5
Raft:
Snapshot Interval: 10000
Number of Old Snapshots to Retain: 0
Heartbeat Tick: 1
Election Tick: 10
Dispatcher:
Heartbeat Period: 5 seconds
CA Configuration:
Expiry Duration: 3 months
Force Rotate: 0
Autolock Managers: false
Root Rotation In Progress: false
Node Address: 192.168.65.3
Manager Addresses:
192.168.65.3:2377
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 773c489c9c1b21a6d78b5c538cd395416ec50f88
runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
init version: 949e6fa
Security Options:
seccomp
Profile: default
Kernel Version: 4.9.93-linuxkit-aufs
Operating System: Docker for Mac
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 7.786GiB
Name: linuxkit-025000000001
ID: OQ6Q:SF73:CGCW:XMZS:FHR4:BXKW:2EG3:KWGE:2EAK:OCTQ:2OWJ:LWCO
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: 140
Goroutines: 332
System Time: 2018-06-19T21:01:05.7712531Z
EventsListeners: 10
HTTP Proxy: gateway.docker.internal:3128
HTTPS Proxy: gateway.docker.internal:3129
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Additional environment details (AWS, VirtualBox, physical, etc.):
Description
It would be useful to support Compose file version 2. The use-case would be to use runtime: nvidia
to access the local GPUs from docker-compose services containers.
(runtime
option is not supported on Compose file version 3, see docker/compose#5360 (comment))
Steps to reproduce the issue:
docker-compose.yaml
with version: '2.4'
docker-app init foo
docker-app render
Describe the results you received:
Error: failed to load Compose file: unsupported Compose file version: 2.4
Describe the results you expected:
docker-app render
works with Compose file version 2.
Output of docker-app version
:
Version: v0.2.0
Git commit: 854872f
Build time: 2018-06-11T15:06:17.093522032+00:00
OS/Arch: linux/amd64
Experimental: off
Renderers: none
Description
The wordpress example shows a helm chart folder ending in .helm
. This should be .chart
.
Steps to reproduce the issue:
docker-app helm wordpress
ls
Describe the results you received:
Example does not match real output:
$ ls
README.md prod-settings.yml with-secrets.yml wordpress.chart wordpress.dockerapp
Describe the results you expected:
Example should match above result.
Output of docker-app version
:
Version: v0.2.0-31-g85ea7e0-dirty
Git commit: 85ea7e0
Built: Wed Jun 20 14:42:45 2018
OS/Arch: darwin/amd64
Experimental: off
Renderers: none
When there's an error, we currently exit with code 0:
$ docker-app help --bad-flag
Error: unknown flag: --bad-flag
$ echo $?
0
Just a small detail but the generated help for <command_name>
, unlike the other help messages, is not capitalized.
$ docker-app init --help
[...]
Flags:
-c, --compose-file string Initial Compose file (optional)
-d, --description string Initial description (optional)
-h, --help help for init
-m, --maintainer stringArray Maintainer (name:email) (optional)
-s, --single-file Create a single-file application
$ docker-app version
Version: 0.1.0-162-g9b311d2
Git commit: 9b311d2
Build time: 2018-06-07T12:36:50.253486313+00:00
OS/Arch: linux/amd64
Experimental: off
Renderers: none
PS: It's not the case if no compose-file is used.
docker-app init -c cp.yml foo
cat foo.dockerapp/settings.yml
cat foo.dockerapp/settings.yml
{}
Version: 0.1.0
Git commit: 9eec848
OS/Arch: linux/amd64
Experimental: off
Renderers:
A few unixisms have crept in which mean this no longer works on Windows. Specifically:
make -f docker.Makefile cross
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
docker build --target= -t docker-app-cross --build-arg COMMIT= --build-arg TAG= --build-arg BUILDTIME= .
$ docker-app version
Version: 0.1.0-155-g301048a
Git commit: 301048a
Build time: 2018-06-06T11:59:46.055462000+00:00
OS/Arch: darwin/amd64
Experimental: off
Renderers: none
$ docker version
Client:
Version: 18.06.0-ce-dev
API version: 1.37
Go version: go1.10.2
Git commit: 7cbcdc0
Built: Tue May 29 14:48:59 2018
OS/Arch: darwin/amd64
Experimental: true
Orchestrator: swarm
Server:
Engine:
Version: 18.06.0-ce-dev
API version: 1.38 (minimum version 1.12)
Go version: go1.10.2
Git commit: 7cbcdc0
Built: Tue May 29 14:56:29 2018
OS/Arch: linux/amd64
Experimental: true
Description
docker-app helm
output isn't compliant with helm lint. The name of the chart of directory is expected to be the name of the chart.
Steps to reproduce the issue:
Regarding an application foo.docker-app
#
# Packing.
#
$ echo $PWD
xxx/foo.docker-app
$ docker-app save
$ docker image ls
foo.dockerapp latest 12d1cb28ad9f 44 seconds ago 5.79kB
[...]
#
# Unpacking.
#
$ ls -l
$ docker-app load foo.dockerapp:latest
$ ls -l
-rw-r--r-- 1 dimrok dimrok 13824 mai 22 15:27 foo.dockerapp
$ docker-app unpack foo.dockerapp
Error: mkdir foo.dockerapp: file exists
Renaming foo.dockerapp
to whatever
and then run docker-app unpack whatever
works well.
$ docker-app version
Version: fb89420-dirty
Git commit: fb89420
OS/Arch: linux/amd64
Experimental: on
Renderers: gotemplate
We're currently missing a CI/CD system and the bootstrapping around that.
Help message show twice.
$ docker-app init
Error: "docker-app init" requires exactly 1 argument.
See 'docker-app init --help'.
Usage: docker-app init <app-name> [-c <compose-file>] [-d <description>] [-m name:email ...] [flags]
Start building a Docker application
"docker-app init" requires exactly 1 argument.
See 'docker-app init --help'.
Usage: docker-app init <app-name> [-c <compose-file>] [-d <description>] [-m name:email ...] [flags]
Start building a Docker application
$ docker-app version
Version: 0.1.0-162-g9b311d2
Git commit: 9b311d2
Build time: 2018-06-07T12:36:50.253486313+00:00
OS/Arch: linux/amd64
Experimental: off
Renderers: none
If you use a pre 3.2 compose-file (with ports or volumes) the resulting compose-file will be invalid.
Example:
$ cat compose-file.yml
version: "3.1"
services:
hello:
image: hashicorp/http-echo
command: ["-text", "hello"]
ports:
- 5678:5678
$ docker-app init version -c docker-compose.yml
$ cd version.dockerapp
$ docker-app render > foo.yml
$ docker stack deploy -c foo.yml app
Creating network app_default
Creating service app_hello
$ docker stack deploy -c foo.yml app
services.hello.ports.0 must be a string or number
We should write a warning and update the version the version of the generated compose-file to 3.6 (or 3.2, the minimum).
$ docker-app version
Version: fb89420
Git commit: fb89420
OS/Arch: linux/amd64
Experimental: off
Renderers: gotemplate
Description
Currently the created helm chart contains the v1beta2 stack struct which is not supported by EE 2.0. We should add the ability to write a helm chart in the v1beta1 format.
Steps to reproduce the issue:
docker-app helm
helm install ...
Describe the results you received:
When doing helm install
against an EE 2.0 cluster, the chart fails to deploy because of a version mismatch.
We currently have the following pattern for errors in cobra lambdas:
fmt.Printf("Some error: %s", err)
os.Exit(1)
This means that we're writing errors to stdout instead of stderr. We can use cobra's RunE
instead which would do the right thing(tm) for us: spf13/cobra#134
Usage says: [-s settings-file...]
and flags say:
-s, --set stringArray Override settings values
-f, --settings-files stringArray Override settings files
[-s key=value...] [-f settings-file...] [flags]
[-e key=value...] [-s settings-file...] [flags]
docker render --help
Usage:
docker-app render <app-name> [-e key=value...] [-s settings-file...] [flags]
Flags:
-h, --help help for render
-s, --set stringArray Override settings values
-f, --settings-files stringArray Override settings files
Version: fb89420
Git commit: fb89420
OS/Arch: linux/amd64
Experimental: off
Renderers: gotemplate
Description
The Wordpress example does not render.
Steps to reproduce the issue:
docker-app render wordpress.dockerapp
Describe the results you received:
Error: failed to load Compose file: volumes.db_data must be a mapping or null
Describe the results you expected:
The rendered Compose file.
Additional information you deem important (e.g. issue happens only occasionally):
Output of docker-app version
:
Version: v0.2.0-23-g913c753
Git commit: 913c753
Built: Thu Jun 14 22:10:02 2018
OS/Arch: darwin/amd64
Experimental: off
Renderers: none
After a docker-app init -s, the settings section contains only {}
. Find a way to make this more readable, maybe by adding a comment at the top of the section.
docker-app render -f settings/development.yml
version: "3.6"
services: {}
docker-app render -f settings/development.yml
Error: open /home/dimrok/docker/apps/from-scratch.dockerapp/settings.yml: no such file or directory
with:
tree
.
├── development
│ └── docker-compose.yml
├── docker-compose.yml
├── Makefile
├── metadata.yml
├── settings
│ └── development.yml
└── settings.yml
docker-app render -f settings/development.yml
version: "3.6"
services: {}
rm settings.yml
docker-app render -f settings/development.yml
Error: open /home/dimrok/docker/apps/from-scratch.dockerapp/settings.yml: no such file or directory
Version: fb89420
Git commit: fb89420
OS/Arch: linux/amd64
Experimental: off
Renderers: gotemplate
In my opinion, having a docker-compose.yml
, which, because of the templating, is not a valid docker-compose.yml
could be confusing.
@garethr, maybe we could rename docker-compose.yml
to docker-compose.tmpl.yml
(or something like that).
The single-file / split-file format currently uses a fixed order for the files that are combined; this approach may not be future-proof / extensible for future enhancements (for example; multiple compose files, or multiple (named) configurations). (Just the file content of each section is likely insufficient to determine its contents, without attempting to fully parse each part, and trying to match it to a schema)
I suggest to either;
This is just a quick write-up to start the discussion, because I keep forgetting to bring this up, and it's important to decide on this before the project reaches GA
$ docker-app render wordpress/wordpress.dockerapp -f wordpress/with-secrets.yml
Error: yaml: line 14: did not find expected key
The name of the key could be nice too.
$ docker-app version
Version: 0.1.0-52-gb207ad0
Git commit: b207ad0
OS/Arch: linux/amd64
Experimental: off
Renderers:
Description
A YAML node can be disabled using a "enabled" key with a value:
version: "3.4"
services:
monitor:
enabled: "! ${myapp.debug}"
But the code handling this feature says that no value means disabling the node too:
version: "3.4"
services:
monitor:
enabled: # monitor is disabled
I suggest we should remove this implicit disable with no value, and error out, as I think that enabling should be explicit too.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.