Search code examples
dockerdockerhubwercker

Using a docker image on Wercker


I am trying to use Wercker to eventually convert libreoffice files to pdf stored in a private Github repo. There are some Docker images on Dockerhub that contain libreoffice such as xcgd/libreoffice which has this dockerfile.

I am new to both Docker and Wercker, so I decided to set up a minimal Wercker.yml to start from (below):

box: xcgd/libreoffice:latest
build:
    steps:
    - script:
        name: test python
        code: echo 123
deploy:
    steps:
    - script:
        name: my deploy script
        code: echo 123

The Wercker build stalls at the "setup environment" step with the last line being

Status: Downloaded newer image for xcgd/libreoffice:latest

And the build eventually times out with

"Command timed out after no response" after 12min 49s.

What am I doing wrong here?

Grateful for answers!


Solution

  • Your wercker.yml looks like a good start, except that Docker is tricky, and using it on Wercker requires specific "incantations" :-)

    It looks like the Docker container you've chosen defines this startoo.sh script as an ENTRYPOINT, which is basically the starting command when the container is loaded, see Dockerfile docs for details.

    Trouble is, Wercker needs an ENTRYPOINT which can run a shell, as shown here in the Wercker docs.

    As specified at the bottom of that Wercker docs page, the good news is you can override the ENTRYPOINT in your wercker.yml script.

    Try changing the top of your wercker.yml to something like:

    box: 
      id: xcgd/libreoffice:latest
      entrypoint: /bin/bash -c
    
    build:
      ...
    

    That should work to run your current Wercker script test steps, but now of course the libreoffice executable won't be running on the container, so later on you'll have to start it by running that script /opt/libreoffice/startoo.sh yourself.