tower-cli icon indicating copy to clipboard operation
tower-cli copied to clipboard

Build a Docker container

Open ewels opened this issue 4 years ago • 7 comments

Seeing as Nextflow is all about containerisation, it would be nice to have this cli readily available in a container 😉

Could build and host via the GitHub container registry etc. Or wherever really.

ewels avatar Nov 17 '21 09:11 ewels

Good idea.

It is possible to use jreleaser to publish it.

Related #128

jordeu avatar Nov 17 '21 10:11 jordeu

Yup, or just GitHub actions

The Dockerfile I just wrote for myself is pretty simple and seems to work well:

FROM alpine

ARG TOWER_CLI_VERSION="0.4"

# Install Tower CLI
RUN apk add --no-cache curl ca-certificates
RUN curl -L https://github.com/seqeralabs/tower-cli/releases/download/v${TOWER_CLI_VERSION}/tw-${TOWER_CLI_VERSION}-linux-x86_64 > tw
RUN chmod +x ./tw
RUN mv tw /usr/local/bin/

ewels avatar Nov 17 '21 10:11 ewels

But of course for automation here you don't want to be downloading releases etc, so yeah might make sense to use jreleaser. I'm just not familiar with it.

ewels avatar Nov 17 '21 10:11 ewels

Now that the Tower CLI has been added to Bioconda, we just have to stay on top of bumping versions there and we will get Biocontainers for free: https://quay.io/repository/biocontainers/tower-cli?tag=latest&tab=tags

x:ref: https://github.com/seqeralabs/tower-cli/issues/293

drpatelh avatar Jul 10 '23 08:07 drpatelh

I very much appreciate whoever set this up, but would it be possible to get the conventional latest and 0.8.0 semantic version tag there as well? As of now, the only tag is 0.8.0--h9ee0642_0. This makes the container harder to initially find and updates need to be looked up manually, including the build tag info on the end.

$ skopeo inspect docker://quay.io/biocontainers/tower-cli
FATA[0001] Error parsing image name "docker://quay.io/biocontainers/tower-cli": reading manifest latest in quay.io/biocontainers/tower-cli: manifest unknown 

$ skopeo inspect docker://quay.io/biocontainers/tower-cli:0.8.0--h9ee0642_0
{
    "Name": "quay.io/biocontainers/tower-cli",
    "Digest": "sha256:98825f778dd02b2803950474dbe80ffb3d0da267d98f65153ff2c2019c995eec",
    "RepoTags": [
        "0.8.0--h9ee0642_0"
    ],

Here's a workaround to get the most recent tag without latest being available and without looking it up, if anyone needs it, but it's not pretty:

podman run docker://quay.io/biocontainers/tower-cli:$(skopeo list-tags docker://quay.io/biocontainers/tower-cli | jq -r '.Tags[0]')

vwbusguy avatar Sep 27 '23 17:09 vwbusguy

The biocontainers image is outside of our control, that's managed via the BioConda + BioContainers communities.

But we could definitely build our own docker images to use as an alternative, using whatever tags we want.

ewels avatar Sep 28 '23 06:09 ewels

I think it would relatively easy to do. The releases are already going out via GitHub actions. We could use JReleaser to do this directly as suggested above.

Looks like JReleaser has support for pushing the images to GitHub Packages, which would probably be the easiest (jreleaser.github.username, jreleaser.gitlab.username etc).

ewels avatar Sep 28 '23 06:09 ewels