opsxcq / tasker

Tasker is a multipurpose task runner
195 stars 17 forks source link

Use a local docker image #6

Open nilsi opened 5 years ago

nilsi commented 5 years ago

I got my project defined in a Dockerfile in the same folder where I define tasker in my docker-compose file. Can I somehow run my local docker image without having to push it to docker hub?

This is what Im trying to do in my docker-compose file:

version: "2"

services:
    tasker:
        image: strm/tasker
        volumes:
            - "/var/run/docker.sock:/var/run/docker.sock"
        environment:
             configuration: |
                 schedule:
                     - every: minute 
                       task: book_pilates
                     - cron: 1 7 * * 6
                       task: book_pilates
                 tasks:
                     docker:
                         - name: book_pilates
                           build:
                              dockerfile: ./Dockerfile
                           script:
                               - python test.py 
                               - python test2.py 

And my Dockerfile in the same folder:

FROM python:3
ADD test.py /
ADD test2.py /
RUN pip install selenium

Sorry if this makes no sense, pretty new to docker.

siben168 commented 4 years ago

I want to ask same questions. i got following errors when i try to run the local image "docker-cron"

2019-12-01 12:34:01.483 ERROR 6 --- [pool-2-thread-1] sh.strm.tasker.runner.DockerTaskRunner : Error running hello task, error:Request error: POST unix://localhost:80/images/create?fromImage=localhost%2Fdocker-cron: 500, body: {"message":"Get http://localhost/v2/: dial tcp [::1]:80: connect: connection refused"} tasker_1 | tasker_1 | tasker_1 | com.spotify.docker.client.exceptions.DockerRequestException: Request error: POST unix://localhost:80/images/create?fromImage=localhost%2Fdocker-cron: 500, body: {"message":"Get http://localhost/v2/: dial tcp [::1]:80: connect: connection refused"}