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

Invalid example of docker executor with volumes #638

Open
piotrwalkusz1 opened this issue Jul 30, 2024 · 0 comments
Open

Invalid example of docker executor with volumes #638

piotrwalkusz1 opened this issue Jul 30, 2024 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@piotrwalkusz1
Copy link

In documentation https://dagu.readthedocs.io/en/latest/yaml_format.html there is an example:

steps:
  - name: deno_hello_world
    executor:
      type: docker
      config:
        image: "denoland/deno:1.10.3"
        container:
          volumes:
            /app:/app:
          env:
            - FOO=BAR
        host:
          autoRemove: true
    command: run https://examples.deno.land/hello-world.ts

This is not the correct way of mounting directories. For example this spec:

steps:
  - name: test
    executor:
      type: docker
      config:
        image: "alpine"
        container:
          volumes:
            /app:/app:
    command: ls /

will create output:

{"status":"Pulling from library/alpine","id":"latest"}
{"status":"Already exists","progressDetail":{},"id":"690e87867337"}
{"status":"Digest: sha256:0a4eaa0eecf5f8c050e5bba433f58c052be7587ee8af3e8b3910ef9ab5fbe9f5"}
{"status":"Status: Downloaded newer image for alpine:latest"}
app:
bin
dev
etc
home
lib
media
mnt
opt
proc
root
run
sbin
srv
sys
tmp
usr
var

Notice the directory with the name "app:" (colon at the end).

Here is the correct spec:

steps:
  - name: test
    executor:
      type: docker
      config:
        image: "alpine"
        host:
          binds:
            - /app:/app
    command: ls /

with output:

{"status":"Pulling from library/alpine","id":"latest"}
{"status":"Digest: sha256:0a4eaa0eecf5f8c050e5bba433f58c052be7587ee8af3e8b3910ef9ab5fbe9f5"}
{"status":"Status: Image is up to date for alpine:latest"}
app
bin
dev
etc
home
lib
media
mnt
opt
proc
root
run
sbin
srv
sys
tmp
usr
var

Related topic: https://stackoverflow.com/questions/48470194/defining-a-mount-point-for-volumes-in-golang-docker-sdk

@yohamta yohamta added bug Something isn't working good first issue Good for newcomers labels Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants