내용으로 건너뛰기

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년 전228회 조회
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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

관련 콘텐츠