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

Mount host directory into bundle #838

Closed
geowa4 opened this issue Jul 5, 2016 · 1 comment
Closed

Mount host directory into bundle #838

geowa4 opened this issue Jul 5, 2016 · 1 comment
Assignees
Milestone

Comments

@geowa4
Copy link

geowa4 commented Jul 5, 2016

At work, we use CoreOS's Fleet to schedule our containers across a few servers. Interaction with Fleet is via a unix socket /var/run/fleet.sock. I would like to build a standard Docker bundle to list, start, and stop units. To do that, I'll need the Relay to send the mount option to the container. I imagine a slight change to the config.yaml as follows.

Current:

docker:
  image: my/bundle
  tag: "0.1"

Proposed:

docker:
  image: my/bundle
  volumes:
    - /path/on/host:/path/on/container
  tag: "0.1"
@christophermaier
Copy link
Collaborator

This is done and available now on the master branch of both Cog and Relay. It will be available in the next release of Cog.

To bind mounts into the container you can do something like this:

docker:
  image: my/bundle
  binds:
    - /path/on/host:/path/on/container
    - /another/host/path:/another/container/path
  tag: "0.1"

binds is a list of strings you would pass as values in HostConfig -> Binds in the POST body for the Docker /containers/create API endpoint

The relevant bit of that documentation for our purposes is quoted here:

host_path:container_path to bind-mount a host path into the container
host_path:container_path:ro to make the bind-mount read-only inside the container.
volume_name:container_path to bind-mount a volume managed by a volume plugin into the container.
volume_name:container_path:ro to make the bind mount read-only inside the container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants