Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
648 views
in Technique[技术] by (71.8m points)

docker - How to mount/copy folder from the git repo to a service container?

I am trying to copy (or should l say mount) a folder and a file from my git repo to a service container in my gitlab-ci.yml file. I dont know how to do it. thats how l want to map it:

volumes:
      - ./myfolder-templates:/templates
      - ./config/mysecondfolder/file.properties:/opt/classes/file.properties

my gitlab-ci.yml file looks like this:

 image: openjdk:11

 build-job:
  services: 
    - name: artifactory.mycompany.com/oracleimage
      alias: test_db
    - name: docker-releases.mycompany.com/anotherimage
      alias: test_other

now, i want to add the above mentioned file and folder to the container whose alias is test_other. How should l go about it? I found many gitlab forum threads. but they all talk about configuring the runner for mounting files. I dont wanna do that. Also saw this. It doesn't answer my question. Is there a way to do that in the yml file? btw. I'm using a shared runner and cant configure it, in case that is relevant.

question from:https://stackoverflow.com/questions/65951894/how-to-mount-copy-folder-from-the-git-repo-to-a-service-container

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...