Docker Community Forums

Share and learn in the Docker community.

Problem Volume mount local

Hello,
Hello,
I created CIFS volumes and then mount them in my container but this one generates new volume instead of using the ones I want

################
version: '3.9' #
services:      #
################
  Plex:
    container_name: 'CN_Plex'
    image: 'plexinc/pms-docker'
    hostname: 'Multimedias'
    domainname: 'lan'
    restart: 'no'
    environment:
      PUID: '1001'
      PGID: '74240'
      TZ: 'Europe\Paris'
      PLEX_CLAIM: 'XXXXXXXXXXXXXXXXXX'
    volumes:
      - '/mnt/docker/volumes/Plex/config:/config'
      - '/mnt/docker/volumes/Plex/transcode:/transcode'
      - '/mnt/docker/volumes/Plex/data:/data'
      - 'Video:/mnt/Video'
    ports:
      - '32400:32400'

volumes:
 Video:

What are the screenshots supposed to show us?

And despite all actual directory locations being in /mnt/Docker/volumes, I think you’re mixing bind mounts (the first 3 in your compose file) with named volumes (the last one)? Are you doing that on purpose?

Hello,

The service has been edited so that the storage volumes are located in /mnt /Docker/.

That doesn’t change/answer my questions. :slight_smile:

Hello,
With the Portainer 2.0.1 its just work and update it’s not work .

Very well, let’s hope others understand what you’re asking. (I don’t.)

What I want is for the volume I created to be used in my container, is that too complicated to understand?

Volumes created outside the compose file need to be declared as “external: true” in order to be used within, see:

2 Likes

Hello,
For the Video volume it’s good, but when editing an error for the Plex volume.

@meyay :
Thank you, it's just works for VIdeo.


Step 1: Create Volume :

docker volume create Plex

Step 2: Create Stack Plex

version: '3.9' 
services:
  Plex:
    container_name: 'CN_Plex'
    image: 'plexinc/pms-docker'
    hostname: 'Multimedias'
    domainname: 'lan'
    restart: 'no'
    environment:
      PUID: '1001'
      PGID: '74240'
      TZ: 'Europe\Paris'
      PLEX_CLAIM: 'XXXXXXXXXXXXXXXXXX'
    volumes:
      - 'Plex/config:/config'
      - 'Plex/transcode:/transcode'
      - 'Plex/data:/data'
      - 'Video:/mnt/Video'
    ports:
      - '32400:32400'
volumes:
 Plex:
  external: true
 Video:
  external: true

ERROR:

Name Volume  'Plex/config:/config/rw' is used in service "Plex" but not declaration not found in the volumes sections.

This is an invalid volume mapping declaration. You can only map the whole volume into a container path, but not a path inside a volume into a container path. You did append a suffix to the volume, which violates the volume mapping convention.