app
app copied to clipboard
Relative paths mounts in volumes renders incorrectly
Description
Mounting a relative path - such as ./mounted-folder - renders as mounted-folder.
Then when running docker-compose up I receive this error:
invalid mount config for type "bind": invalid mount path: 'mounted-folder' mount path must be absolute.
I would expect the source path to stay as is.
Steps to reproduce the issue:
- My
.dockerappfile
version: 0.1.0
name: test
---
version: "3.6"
services:
hello:
image: hashicorp/http-echo
volumes:
- ./mounted-folder:/mounted-folder
---
{}
- Run
docker app render
Describe the results you received:
version: "3.6"
services:
hello:
image: my-image
volumes:
- type: bind
source: mounted-folder
target: /mounted-folder
Describe the results you expected:
version: "3.6"
services:
hello:
image: my-image
volumes:
- type: bind
source: ./mounted-folder
target: /mounted-folder
Output of docker version:
Client: Docker Engine - Community
Version: 19.03.1
API version: 1.40
Go version: go1.12.5
Git commit: 74b1e89
Built: Thu Jul 25 21:18:17 2019
OS/Arch: darwin/amd64
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 19.03.1
API version: 1.40 (minimum version 1.12)
Go version: go1.12.5
Git commit: 74b1e89
Built: Thu Jul 25 21:17:52 2019
OS/Arch: linux/amd64
Experimental: true
containerd:
Version: v1.2.6
GitCommit: 894b81a4b802e4eb2a91d1ce216b8817763c29fb
runc:
Version: 1.0.0-rc8
GitCommit: 425e105d5a03fabd737a126ad93d62a9eeede87f
docker-init:
Version: 0.18.0
GitCommit: fec3683
Output of docker-app version:
Version: v0.8.0
Git commit: 7eea32b7
Built: Thu Jul 25 21:26:00 2019
OS/Arch: darwin/amd64
Experimental: off
Renderers: none
Invocation Base Image: docker/cnab-app-base:v0.8.0
Output of docker info:
Client:
Debug Mode: false
Plugins:
app: Docker Application (Docker Inc., v0.8.0)
buildx: Build with BuildKit (Docker Inc., v0.2.2-10-g3f18b65-tp-docker)
Server:
Containers: 13
Running: 4
Paused: 0
Stopped: 9
Images: 41
Server Version: 19.03.1
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 local logentries splunk syslog
Swarm: active
NodeID: sf6i0kaitvdk1oy9p8k9h1vf1
Is Manager: true
ClusterID: 044hk80wcl7rw968ijom7vi4t
Managers: 1
Nodes: 1
Default Address Pool: 10.0.0.0/8
SubnetSize: 24
Data Path Port: 4789
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: 894b81a4b802e4eb2a91d1ce216b8817763c29fb
runc version: 425e105d5a03fabd737a126ad93d62a9eeede87f
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 4.9.184-linuxkit
Operating System: Docker Desktop
OSType: linux
Architecture: x86_64
CPUs: 6
Total Memory: 1.952GiB
Name: docker-desktop
ID: 4VMB:BMJ2:FKFI:G6WP:3FX5:NV67:4YIA:QJHH:LF3R:EUZB:Y7ZP:7FER
Docker Root Dir: /var/lib/docker
Debug Mode: true
File Descriptors: 123
Goroutines: 253
System Time: 2019-07-29T11:42:02.253667702Z
EventsListeners: 3
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
Product License: Community Engine
Hello @maxhr Thank you for reporting this issue.
Is there any temporary workaround for this one?
We are addressing this issue among others on render, with #602 . I think it should fix this particular issue. cc @aiordache
I was testing this issue with 0.9.0-zeta1.
Things has changed, but there are still things to clarify.
Having volume:
volumes:
- "./db_tisapi:/var/lib/postgresql/data"
- "./db_tisapi_init:/docker-entrypoint-initdb.d"
rendering results in:
volumes:
- type: bind
source: /cnab/app/ttt.dockerapp/db_tisapi
target: /var/lib/postgresql/data
- type: bind
source: /cnab/app/ttt.dockerapp/db_tisapi_init
target: /docker-entrypoint-initdb.d
so it ignores current directory and assumes, that the relative folder is relative to folder /cnab/app.
This makes rendering of docker-compose.yml not usable for docker-compose command.
Possible solutions:
- skip: skip supporting
docker app renderfordocker-composeusing volumes bound to relative folder. Call this use case as out of scope fordocker app. - render-mode: Introduce option
--render-modewith optionsdocker-composeandapp.docker-composewould respect relative folders,appwould assume relative folders to be relative to/cnab/app. Defaultrender-modewould beapp. - volumes-root: Introduce option
--volumes-rootdefaulting to/cnab/app.
I would prefer the render-mode solution as it brings real value to docker-compose users allowing to parametrize the application as needed.