跳至内容

The dir permission of AWS batch job hosted on ec2 is 755.

0
  1. Format the nvme storage as xfs in the launch template and then mount it. After that, I changed the directory to 777. in user data section. As follows
- temp_dir=/temp
- mkdir -p ${temp_dir}
- mkfs -t xfs /dev/nvme1n1
- mount /dev/nvme1n1 /temp
- chmod 777 /temp
  1. I set launch template in the AWS batch computing environment.
  2. I created a directory in the docker file, changed it to 777 using chmod, prepared to bind mount the directory using VOLUME, and pushed it to ecr. As follows
RUN mkdir -p /data/Analysis
RUN chmod 777 /data/Analysis
RUN adduser ad
RUN chown ad /data/Analysis
VOLUME ["/data/Analysis"]
  1. Volume and mount were specified in Job definitions of AWS batch. As follows
   "volumes": [
      {
        "host": {
          "sourcePath": "/temp"
        },
        "name": "temp"
      }
    ],
    "mountPoints": [
      {
        "containerPath": "/data/Analysis",
        "readOnly": false,
        "sourceVolume": "temp"
      }

However, inside the batch job, the directory is set to 755. How can I change it to 777?

已提问 2 年前231 查看次数
2 回答
1

I believe your issue is caused by the following lines in your Dockerfile:

RUN chmod 777 /data/Analysis
RUN chown ad /data/Analysis
VOLUME ["/data/Analysis"]

Can you please remove those lines and see if it resolves your problem?

The first two lines are useless, since the mounted filesystem will override any changes you make to the mount point in your container image. And you do not need a VOLUME declaration in this situation.

AWS
专家
已回答 2 年前
  • Thanks for answering my question. I tried it without those lines at first, but it was set to 755. I used instance store, but since I used ebs instead of instance store, it was set to 777. However, I still don't know why the instance store is set to 755.

0
已接受的回答

Instance store is set to 755 no matter what you do. With EBS, 777 is possible. I still don't know why I can't set the instance store to 777.

已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。