0

I am trying to mount fsx in the Dockerfile with following command:

RUN mount -t lustre file_system_dns_name@tcp:/mountname /mnt/fsx -o noatime,flock

But it throws following error:

INFO:batscli.process.process_runner:stdout> {"event": "Docker image build failed, please check log output", "exc_info": true, "exception": {"args": ["The command '/bin/sh -c mount -t lustre file_system_dns_name@tcp:/mountname /mnt/fsx -o noatime,flock' returned a non-zero code: 22"], .....

I cannot write the mount command in separate bash file, because I need it in BATS_TRANSFORM package, which only copies Dockerfile, and not other shell scripts.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Shweta
  • 1,111
  • 3
  • 15
  • 30
  • You can't run `mount` in a Docker container at all, unless you give the container unusual privileges. You can't give the build sequence those privileges, and therefore you can't run `mount` in a Dockerfile ever. (In any case, the built image wouldn't persist the mount.) – David Maze Apr 03 '21 at 00:42
  • I know people have done it in the docker. But they do it by adding above line in a shell script and calling it from dockerfile. The only problem here is that I need it build it with BATS_TRANSFORM package, which only copies Dockerfile, and not other shell scripts. So i guess my struggle is why mount command works if we write in separate shell scipt, but not when it is added in Dockerfile. I guess it has to do something with formatting. – Shweta Apr 04 '21 at 19:18
  • did you found answer? – Janarthanan Ramu Apr 13 '21 at 15:39
  • It has to do with the the version of AL2 AMI. Change it to older version of the AMI, and should work. – Shweta Apr 13 '21 at 20:44

0 Answers0