Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Rex ray AWS S3外部卷docker(docker compose不工作)_Docker_Amazon S3_Docker Compose_S3fs_Rexray - Fatal编程技术网

Rex ray AWS S3外部卷docker(docker compose不工作)

Rex ray AWS S3外部卷docker(docker compose不工作),docker,amazon-s3,docker-compose,s3fs,rexray,Docker,Amazon S3,Docker Compose,S3fs,Rexray,我正在尝试将postgres和pgadmin与AWS S3上的rex ray外部卷一起使用。 我做到了: 然后我创建了两个卷(用于postgres和pgadmin): 运行docker volume ls时可以看到卷 我现在尝试在docker compose中使用这些外部S3卷,但它不起作用,S3中也没有创建任何内容: version: "3.8" services: pgAdmin: restart: always container_name: pga

我正在尝试将postgres和pgadmin与AWS S3上的rex ray外部卷一起使用。 我做到了:

然后我创建了两个卷(用于postgres和pgadmin):

运行
docker volume ls
时可以看到卷

我现在尝试在docker compose中使用这些外部S3卷,但它不起作用,S3中也没有创建任何内容:

version: "3.8"
services:
  pgAdmin:
    restart: always
    container_name: pgadmincontainer
    image: dpage/pgadmin4:4.25
    ports:
      - "8000:80"
    environment:
      PGADMIN_DEFAULT_EMAIL: email@admin.com
      PGADMIN_DEFAULT_PASSWORD: 1234
    volumes:
      - myrexvol1-1234:/var/lib/pgadmin
  postgres:
    image: postgres
    container_name: databasecontainer
    restart: always
    environment:
      POSTGRES_USER: me
      POSTGRES_PASSWORD: password
      POSTGRES_DB: database
    ports:
      - 5432:5432
    volumes:
      - ./sqlscripts:/docker-entrypoint-initdb.d
      - myrexvol2-1234:/var/lib/postgresql/data
volumes:
  myrexvol1-1234:
    name: myrexvol1-1234
    external: true
  myrexvol2-1234:
    name: myrexvol2-1234
    external: true
我做错了什么?奇怪的是,我可以在容器中手动创建一些东西,然后它会反映在S3 bucket中,即:

docker container run -it -v myrexvol2-1234:/myvol centos
  ...inside the container here...
# cd /myvol
# date >mydate
# ls -l
version: "3.8"
services:
  pgAdmin:
    restart: always
    container_name: pgadmincontainer
    image: dpage/pgadmin4:4.25
    ports:
      - "8000:80"
    environment:
      PGADMIN_DEFAULT_EMAIL: email@admin.com
      PGADMIN_DEFAULT_PASSWORD: 1234
    volumes:
      - myrexvol1-1234:/var/lib/pgadmin
  postgres:
    image: postgres
    container_name: databasecontainer
    restart: always
    environment:
      POSTGRES_USER: me
      POSTGRES_PASSWORD: password
      POSTGRES_DB: database
    ports:
      - 5432:5432
    volumes:
      - ./sqlscripts:/docker-entrypoint-initdb.d
      - myrexvol2-1234:/var/lib/postgresql/data
volumes:
  myrexvol1-1234:
    name: myrexvol1-1234
    external: true
  myrexvol2-1234:
    name: myrexvol2-1234
    external: true
docker container run -it -v myrexvol2-1234:/myvol centos
  ...inside the container here...
# cd /myvol
# date >mydate
# ls -l