Skip to content
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 option in job-run config to use volumes from an existing container #292

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions core/runjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type RunJob struct {
Hostname string
Container string
Volume []string
VolumesFrom []string
Environment []string

containerID string
Expand Down Expand Up @@ -177,6 +178,7 @@ func (j *RunJob) buildContainer() (*docker.Container, error) {
NetworkingConfig: &docker.NetworkingConfig{},
HostConfig: &docker.HostConfig{
Binds: j.Volume,
VolumesFrom: j.VolumesFrom,
},
})

Expand Down
6 changes: 6 additions & 0 deletions docs/jobs.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ This job can be used in 2 situations:
- **INI config**: `Volume` setting can be provided multiple times for multiple mounts.
- **Labels config**: multiple mounts has to be provided as JSON array: `["/test/tmp:/test/tmp:ro", "/test/tmp:/test/tmp:rw"]`
- *default*: Optional field, no default.
- **VolumesFrom**
- *description*: Use the volumes from another container.
- *value*: The name of the container, from which the volumes will be used.
- **INI config**: `VolumesFrom` setting can be provided multiple times for multiple mounts.
- **Labels config**: multiple mounts has to be provided as JSON array: `["container-foo", "bar-container"]`
- *default*: Optional field, no default.
- **Environment**
- *description*: Environment variables you want to set in the running container.
- *value*: Same format as used with `-e` flag within `docker run`. For example: `FOO=bar`
Expand Down