This repository was archived by the owner on May 9, 2022. It is now read-only.
Update for new Docker API#17
Merged
Merged
Conversation
This adds a new spec test that will mount a local directory and have the docker container launched create a file in that directory. This is to ensure that the volume mounts are operating as expected.
Docker Engine API has deprecated passing in options when starting the container and now expects all volumes/binds to be passed in when the container is created
parkr
approved these changes
Apr 3, 2018
|
|
||
| config = CONFIG.merge( | ||
| :Entrypoint => ['/usr/bin/touch', '/volume-test/test'], | ||
| :volumes => { '/volume-test' => test_dir + ":rw"} |
Contributor
There was a problem hiding this comment.
Barely remembering what is going on here... funny that this is :volumes instead of :Volumes – is that intentional?
Contributor
Author
There was a problem hiding this comment.
Yep. The api is such that lower case keys are processed by hoosegow and the rest are passed through to the docker api.
Contributor
|
👍 |
dpmex4527
added a commit
that referenced
this pull request
Aug 7, 2019
This adds a new spec test that will mount a local directory and have the docker container launched copy the `/etc/hosts` file to that directory. This is to ensure that volume mounts still work as expected (see #17) and that any custom @container_options passed in to Hoosegow that use the `:HostConfig` key get properly configured. In this case, we're testing that the `:ExtraHost` option properly adds the list of hostname/IP mappings to the containers `/etc/hosts` file.
dpmex4527
added a commit
that referenced
this pull request
Aug 7, 2019
Activesupport's `deep_merge` hash method will recursively merge hashes so that duplicate keys will not overwrite each other. #17 introduced a change where we now configure volume binds at create time by using the `:HostConfig` option to do this. This makes it so that any other custom docker option that uses `:HostConfig` (such as `:ExtraHosts`) will get overwritten in the .merge in favor of the default volume `:Bind` configuration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update volume mounts for new docker api
Docker Engine API has deprecated passing in options when starting the container and now expects all volumes/binds to be passed in when the container is created.
This also adds a spec test to verify that volume mounts are actually active by mounting a local directory into a container then having the container create a file in that directory, and having the test verify it was successfully created.