Use AWS EFS with gitlab-runner machine+docker

Hi all,

i try to use an aws efs volume in my cicd

i have an instance with an efs
127.0.0.1:/ 8.0E 495M 8.0E 1% /mnt/efs/fs1

i launch gitlab-runner with this efs as volume

docker run -d --name gitlab-runner --restart always -v /srv/gitlab-runner/config:/etc/gitlab-runner -v /mnt/efs/fs1:/mnt/efs/fs1 -v /var/run/docker.sock:/var/run/docker.sock gitlab/gitlab-runner:latest

with inspect i can find it in mounts

{
“Type”: “bind”,
“Source”: “/mnt/efs/fs1”,
“Destination”: “/mnt/efs/fs1”,
“Mode”: “”,
“RW”: true,
“Propagation”: “rshared”
},

In my gitlab-runner/config/config.toml
i just set alpine as image and a volumes

[[runners]]
  name = "aws docker cicd"
  url = "https://gitlab.com/"
  token = "9fqa6ZJYx4gCYAQw2oxD"
  executor = "docker+machine"
  limit = 5
  volumes = ["/mnt/efs/fs1:/mnt/efs/fs1:rw"]
  [runners.docker]
    image="alpine"
    privileged = true
    disable_cache = true
  [runners.cache]
    Type = "s3"
    Shared = true
    [runners.cache.s3]
      ServerAddress = "s3.amazonaws.com"
      AccessKey = "XXX"
      SecretKey = "XXX"
      BucketName = "cicd"
      BucketLocation = "eu-west-3b"
   [runners.machine]
    IdleCount = 0
    IdleTime = 120
    MaxBuilds = 5
    MachineDriver = "amazonec2"
    MachineName = "cicd-runner-%s"
    MachineOptions = [
      "amazonec2-access-key=XXX",
      "amazonec2-secret-key=XXX",
      "amazonec2-region=eu-west-3",
      "amazonec2-vpc-id=vpc-6ca87804",
      "amazonec2-subnet-id=subnet-5bfdeb20",
      "amazonec2-zone=b",
      "amazonec2-use-private-address=false",
      "amazonec2-security-group=CICD-gitlab-runner",
      "amazonec2-instance-type=t2.micro",
    ]

In my .gitlab-ci.yml

i just do
df -h
and
date > /mnt/efs/fs1/build.txt

I can’t find my efs drive and so i can’t write in it.

Does i need to configuration something on the image to use this efs drive ?
If someone can help me, thank you in advence

I try to follow this link to help me but without succes