Skip to content

How to mount file from repository to the service container's volume? #42127

Answered by bconway
nuteee asked this question in Actions
Discussion options

You must be logged in to vote

I've been using the following workaround to do this for a couple years now, but I can't seem to find the original link where I got the idea/syntax, which is what led me to this thread. If it helps anyone, here are my snippets. In this case, I'm using the Mosquitto MQTT service for integration tests, and want to mount configuration and password files rather than disabling authentication.

The build runs in a Go container (may not be relevant):

    container:
      image: golang:1.21-alpine

The MQTT service container is started:

    services:
      mqtt:
        image: eclipse-mosquitto:2.0
        volumes:
          - ${{ github.workspace }}/build/volume/mosquitto:/mosquitto/config
       …

Replies: 16 comments 17 replies

Comment options

You must be logged in to vote
9 replies
@hikouki-gumo
Comment options

@airtower-luna
Comment options

@hikouki-gumo
Comment options

@airtower-luna
Comment options

@ShaharSep
Comment options

Comment options

You must be logged in to vote
2 replies
@nesl247
Comment options

@mannion007
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@danon
Comment options

@bkuhl
Comment options

Comment options

You must be logged in to vote
4 replies
@Mr-Bizeps
Comment options

@commonism
Comment options

@bconway
Comment options

@commonism
Comment options

Answer selected by nuteee
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD Question Ask and answer questions about GitHub features and usage