Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mounting relative volume from git stack #2368

Closed
sqrtroot opened this issue Oct 13, 2018 · 10 comments
Closed

Mounting relative volume from git stack #2368

sqrtroot opened this issue Oct 13, 2018 · 10 comments

Comments

@sqrtroot
Copy link

Bug description
Portainer mounts the volume not based on absolute path of the host. But relative to container root?

Expected behavior
Mounting the relative path should be relative to the docker-compose.yaml file. It somehow mounts
/data/compose/13/Config/HomeAssistant on the host instead of /var/lib/docker/volumes/portainer_data/_data/compose/13/Config/HomeAssistant

Briefly describe what you were expecting.

Steps to reproduce the issue:

Steps to reproduce the behavior:

  1. Create a stack with a relative mount in a git repo
version: "2"
services:
  home-assistant:
    image: homeassistant/home-assistant
    volumes:
      - ./Config/HomeAssistant:/config
  1. Start the stack trough portainer
  2. See a new folder on the host /data... and see that folder mounted instead of the correct folder

Technical details:

  • Portainer version: Both latest and develop tag
  • Docker version (managed by Portainer): Docker version 18.06.1-ce, build e68fc7a
  • Platform (windows/linux): Linux 4.9.0-8-amd64 SMP Debian 4.9.110-3+deb9u6 (2018-10-08) x86_64 GNU/Linux
  • Command used to start Portainer (docker run -p 9000:9000 portainer/portainer):docker run --name portainer -d -p 80:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer:develop

Additional context
When deploying by nativly cloning and running docker-compose up this doesn't occur

@sqrtroot
Copy link
Author

sqrtroot commented Oct 13, 2018

Output of docker inspect (interesting mount part)

"Mounts": [
            {
                "Type": "bind",
                "Source": "/data/compose/13/Config/HomeAssistant",
                "Destination": "/config",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],

@sqrtroot
Copy link
Author

Just tested this with alpine instead of home assistant. The issue still persists

@sqrtroot
Copy link
Author

It also shows this behaviour when you don't use a git repo but just a plain docker-compose file from the text editor

@sqrtroot
Copy link
Author

Any suggestions on where this problem could come from? I've read #1647 should fix that, but it doesn't look like it does.

@sqrtroot
Copy link
Author

?

@simon-rohart
Copy link

Hello,
I also encounter this problem

@michelkaeser
Copy link

+1 I have the same expectations as OP

@deviantony deviantony added this to Need triage in Bug triage via automation Dec 23, 2018
@stephenhouser
Copy link

stephenhouser commented Jun 21, 2019

+1 same problem and expectations as OP.

As a workaround (Linux host):

  • Use local bind mount when running portainer (as in sample portainer-compose project) to /opt/portainer/data
  • On host create a symlink from /data to /opt/portainer/data

@tomwiggers
Copy link

Hi,

This problem still persists. I understand it might be difficult to solve when pasting the contents of a compose-file in Portainer but shouldn't it be easier to fix when a repo is used? Clone the whole thing, then use paths relative to the compose file.

@ghost ghost added the duplicate label Apr 16, 2020
@ghost
Copy link

ghost commented Apr 16, 2020

Closing as a duplicate of #2046

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants