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

Allow mount_paths to be absolute #268

Merged
merged 1 commit into from Jul 11, 2019
Merged

Conversation

stepchowfun
Copy link
Owner

@stepchowfun stepchowfun commented Jul 11, 2019

Allow mount_paths to be absolute. This is to support mounting the Docker IPC socket (usually located at /var/run/docker.sock) in the container for running Docker commands in tasks.

Example toastfile:

image: ubuntu
tasks:
  install_docker:
    command: |
      apt-get update
      apt-get install --yes curl
      curl -fsSL https://get.docker.com | sh
  run_container:
    cache: false
    mount_paths:
      - /var/run/docker.sock
    command: docker run hello-world

Output before this change:

$ toast
[ERROR] Unable to parse file toast.yml. Reason: Task run_container has an absolute mount_path: /var/run/docker.sock.

Output after this change:

$ toast
[INFO] Ready to run 2 tasks: install_docker and run_docker.
[INFO] Running task install_docker…
[INFO] Running task run_docker…

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

cc @bobhenkel

Status: Ready

Fixes: #225

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

Successfully merging this pull request may close these issues.

None yet

1 participant