-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for volume mounting in docker backend #171
Comments
This is exactly what I was just looking for. |
Given that the docker backend operates over the docker API, as opposed to a shell invocation, I'm not sure how such an Lines 188 to 198 in f810296
|
Volumes to mount would be the one I've run into. |
I'm in favor of a volume mounting configuration option, yep 👍 |
@detro is volume mounting enough? What other capabilities do you need? |
IMHO allowing anything the Docker GO client API allow would be the best resolution to this. But I understand that that might be too much to work on, given we could only present the "volume mounting" as an example. I'd leave to the final implementer the ultimate call: at the end of the day I said I was going to provide a PR but I didn't. So I'll accept any outcome :) SIDENOTE: How did I circumvent this in our Travis CI Enterprise? I have created a container off the Travis official base container (the |
@detro Allowing anything the client API allows sounds like a maintenance fun time to me 😁. I think your solution for getting a volume mount is reasonable, but I can also see the value in providing first-class support for volume mounting. If you're OK with it, I'd like to alter the title of this issue to be volume-specific. Alternatively, I can start a separate issue specifically for volume mounting feature discussion. What do you think? |
I totally understand. Go with the renaming and volume only: I think it's already a great extra feature to have. Maintenance is super important in modern software, and I can't counter argue that supporting "anything the API do" would be a nightmare ;) Thanks a lot for your help!Ivan De Marino
|
Just to clarify, until this issue is fixed, is it currently impossible to access the cloned git repo from inside a Docker container (given that -v and --volumes-from don't seem to do anything)? |
@Kazade I think I need more detail about what you're trying to do in order to comment 😃 |
I would love to see this as I was trying to work on a use case but got blocked by this. The thought was to test multiple rubies with kitchen in a docker container but to mount the rubies from travis so we could still leverage cache. |
@meatballhat I have a Docker image that has a custom toolchain that I need to use to compile the code from my repo. Without volume mounting I have to re-clone the repo and checkout the branch into the container :( |
I began working on adding support for arbitrary read-only and read-write volume mounts, only to find that the docker client library we've been using is ill-equipped for the job. I expect what we will have to do first is #351. |
That's precisely why I didn't open a PR: I'm not versed in Go but I thought I could wing it. But when I realised the library for Docker needed to be updated too, my impact could have been way too big. So I gave up. We remain hopeful for an official-maintainer fix :) |
Yay for progress: #362 |
Closed via #373 🎉 To be released 🔜 |
Do we have an ETA of when this will be released? Kinda eagerly waiting for it 😉 |
@Kazade Sorry for the delay! I'm hoping to get a release out today 👍 |
Is there an example of how this works somewhere? I've tried this:
And loads of variations on that, but I can't seem to get anything to mount in the Docker container, it doesn't seem to have any affect. Am I using it wrong? |
I've got the same question as @Kazade, need to use this so an example would be fantastic. Thanks in advance. |
See the comment here: #373 (comment) |
It looks like issue shouldn't be marked as closed since the fix seems to be only for enterprise customers of Travis? (per comment linked above). It'd be really nice to be able to mount the build workspace (if not arbitrary directories) into the container. |
Travis doesn't allow you to mount volumes in docker containers and swallows this error without failing. Use the jar directly instead. ref: travis-ci/worker#171
@ffledgling Mounting arbitrary directories is not something we intend to offer for hosted Travis CI given the security implications. Please see #373 (comment) ❤️ |
@ffledgling looking through the linked commit (ffledgling/pdns-go-tooling@58f1840) I wonder if we're talking about different things. On sudo-enabled Linux, running docker however you choose should work fine (with the exception of docker-in-docker). If you are seeing otherwise, please be sure to contact support@travis-ci.org. |
Hey folks, I have started using this feature (it's awesome). But it's not documented anywhere. I'd mend that ;) Or, if the doc is a repository, happy to contribute. |
PR ready travis-ci/docs-travis-ci-com#1762 |
When using Docker as provider, Travis Worker doesn't currently allow to control the options for the command:
Right now, only providing a
CMD
for[COMMAND]
is allowed.Allowing to define some default
[OPTIONS]
used by the worker when launching containers could be beneficial to, for example, provide a list of volumes to mount in the container.I can try to provide a PR in the next days, but my knowledge of Go is close to 0.
In the meantime, what do you guys think?
Thanks
Ivan
The text was updated successfully, but these errors were encountered: