Build & Run

This guide covers how you can can build and run an executable with a Docker backend. Most of what is covered in the Native Executable guide is true for executables with a Docker backend.

Building the executable

If you have multiple platforms defined in your Viash config file, use the --platform argument of viash build to specify you want to create an executable with a Docker backend.

viash build config.vsh.yaml --platform docker --output bin

Running the executable

You can run the executable by executing it as a command:

bin/hello_world

Executable with a Docker backend include functions to create a Docker image and a container based on your Viash config file. When you run the executable for the first time, both the image and container will built, followed by running the executable inside of the container:

[notice] Checking if Docker image is available at 'hello_world:latest'
[warning] Could not pull from 'hello_world:latest'. Docker image doesn't exist or is not accessible.
[notice] Building container 'hello_world:latest' with Dockerfile
Hello World

If you already have the container on your system, that will be used to run the executable:

Hello World

What’s next?

Now you know how to build and run executables with a Docker backend, you may be interested in building and running Nextflow modules.