canvas
canvas copied to clipboard
Dockerfile?
To make it easier to run on container-aware linux distributions, it might be good to distribute a Docker Image or at least a Dockerfile.
FROM mono
RUN mkdir /canvas
COPY * /canvas/
ENTRYPOINT ["mono", "/canvas/Canvas.exe"]
CMD ["--help"]
Thanks @alanhoyle ! This is on our TODO list.
The Dockerfile above building "FROM mono" docker image no longer works with the current Canvas.
Here is an updated Dockerfile that builds off of the microsoft/dotnet docker image.
FROM microsoft/dotnet:sdk
ARG CANVAS_VERSION=1.39.0.1598
ENV CANVAS_VERSION=${CANVAS_VERSION}
RUN curl -L https://github.com/Illumina/canvas/releases/download/${CANVAS_VERSION}%2Bmaster/Canvas-${CANVAS_VERSION}.master_x64.tar.gz | tar xvz && ln -s /Canvas-${CANVAS_VERSION}+master_x64 /canvas && rmdir /${CANVAS_VERSION}+master
# the Canvas executable requires being run by bash, so adding the #! to it lets it work:
RUN echo '#! /usr/bin/env bash' | cat - /canvas/Canvas > /TEMP && mv /TEMP /canvas/Canvas
# the dotnet executable requires $HOME/.dotnet. In some environments, this does not exist or
# the user doesn't have write permissions. This changes it to /tmp so it's available to anyone.
ENV HOME=/tmp
RUN chmod +x /canvas/Canvas
ENV PATH="/canvas:${PATH}"
CMD Canvas --help
Note that I can't find in the Canvas source code where the Canvas bash script is located. The above Dockerfile builds an image based on the 1.39.0.1598 release of Canvas and the most recent version of the Microsoft dotnet SDK.