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

Git Compose Deploy Issue - flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file #11023

Open
2 tasks done
Sprooty opened this issue Jan 27, 2024 · 3 comments
Labels

Comments

@Sprooty
Copy link

Sprooty commented Jan 27, 2024

Before you start please confirm the following.

Problem Description

  • I have a docker compose and a Caddyfile. The CaddyFile is in the same path as the docker-compose file
  • When i try create container in portainer using git repo, i receive error
Deployment error
failed to deploy a stack: Network winrardockerrepo_network_default Creating Network winrardockerrepo_network_default Created Container caddy Creating Container caddy Created Container caddy Starting Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/data/compose/49/Network/Caddyfile" to rootfs at "/etc/caddy/Caddyfile": mount /data/compose/49/Network/Caddyfile:/etc/caddy/Caddyfile (via /proc/self/fd/6), flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type 
  • Moving Caddyfile into a sub-folder and reflecting in docker-compose results in same error.

  • Deploying this docker-compose via git-clone and docker compose up --build directly on my host works fine. This issue is only occurring in Portainer.

Expected Behavior

Container should be deplorable in entertainer

Actual Behavior

  1. Fill in Create Stack details using git repo. I already have multiple containers working from this repo.
  2. Click "Deploy this stack "
  3. Error thrown
Deployment error
failed to deploy a stack: Network winrardockerrepo_network_default Creating Network winrardockerrepo_network_default Created Container caddy Creating Container caddy Created Container caddy Starting Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/data/compose/49/Network/Caddyfile" to rootfs at "/etc/caddy/Caddyfile": mount /data/compose/49/Network/Caddyfile:/etc/caddy/Caddyfile (via /proc/self/fd/6), flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type 

Steps to Reproduce

See attached example docker-compose.yml. You will need a generic Caddyfile.

Portainer logs or screenshots

SNAG-0000

version: '3.7' services: caddy: image: iarekylew00t/caddy-cloudflare:latest container_name: caddy ports: - 80:80 - 443:443 volumes: - ./Caddyfile:/etc/caddy/Caddyfile - caddy_data:/data - caddy_config:/config environment: - CF_API_TOKEN=XXXXXXXXXXXXXXXXXXXX volumes: caddy_data: caddy_config:

Portainer version

2.19.4

Portainer Edition

Community Edition (CE)

Platform and Version

Docker version 20.10.23, build 7155243 Docker Compose version v2.24.1

OS and Architecture

Ubuntu 22.04

Browser

Firefox

What command did you use to deploy Portainer?

docker volume create portainer_data
#
docker run -d --name=portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v  portainer_data:/data -e PGID=1000 -e PUID=1000 -p 9000:9000 -p 2375:2375 portainer/portainer-ce:latest

Additional Information

No response

@drallgood
Copy link

Was this ever resolved? Running into the same issue

@Sprooty
Copy link
Author

Sprooty commented Apr 3, 2024

Bug only occurs in Portainer. Running compose on the machine directly works fine. So i have worked around it..

@cblack1928
Copy link

Definitely seems like a bug of some kind. I had the same problem and like Sprooty I eventually had to just run from the host command line. Identical setup but it could not run from inside portainer. Failed on the Caddyfile

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

No branches or pull requests

3 participants