Issue with Docker Toolbox install - mingw path conversion

New here, just trying Qiime2 for the first time and certainly not an advanced linux user.

Successfully installed 2017.6 with docker toolbox as I’m using Windows10 Home and confirmed the installation by:

docker run -t -i -v $(pwd):/data qiime2/core:2017.6 qiime

*Though I did I notice the q2-types command didn’t appear in the output list, that’s not what this post is about and might be a non-issue…

I’m unable to run any of the commands, for example even just “qiime” returns “command not found”

My best non-expert guess is that this may be a path issue and may be related to mingw path conversion which I’ve read about in other forums. The conversions are explained here

$ $PATH qiime
bash: /c/Users/Bod/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Program: No such file or directory

docker version

$ docker version
Client:
Version: 17.05.0-ce
API version: 1.29
Go version: go1.7.5
Git commit: 89658be
Built: Fri May 5 15:36:11 2017
OS/Arch: windows/amd64

Server:
Version: 17.05.0-ce
API version: 1.29 (minimum version 1.12)
Go version: go1.7.5
Git commit: 89658be
Built: Thu May 4 21:43:09 2017
OS/Arch: linux/amd64
Experimental: false

1 Like

Hi @Mehrbod_Estaki, apologies that the docker instructions aren’t fully written yet. It actually sounds like you have a fully functional install of docker, and also have the qiime2 image pulled down! The reason you don’t have qiime available in your PATH is because docker runs all commands and environments in a sandboxed execution container (so, this is actually by design). Right now there are two strategies for executing qiime commands in the docker container: ad hoc, or in an interactive shell session. The command example you provided above falls into the “ad hoc” category, you craft a docker command (docker run -t -i -v $(pwd):/data qiime2/core:2017.6), then append your qiime command to the end (qiime, or qiime info, for example).

Strategy One (ad hoc)

So, now for an example of how this works. If you wanted to run the following qiime commands (these are just example commands that might be run as part of an analysis):

$ qiime demux emp-single \
  --i-seqs emp-single-end-sequences.qza \
  --m-barcodes-file sample-metadata.tsv \
  --m-barcodes-category BarcodeSequence \
  --o-per-sample-sequences demux.qza

$ qiime demux summarize \
  --i-data demux.qza \
  --o-visualization demux.qzv

To run those commands in docker, you would modify those commands to look like this:

$ docker run -t -i -v $(pwd):/data qiime2/core:2017.6 \
  qiime demux emp-single \
    --i-seqs emp-single-end-sequences.qza \
    --m-barcodes-file sample-metadata.tsv \
    --m-barcodes-category BarcodeSequence \
    --o-per-sample-sequences demux.qza

$ docker run -t -i -v $(pwd):/data qiime2/core:2017.6 \
  qiime demux summarize \
    --i-data demux.qza \
    --o-visualization demux.qzv

A quick note on the docker run -t -i -v $(pwd):/data qiime2/core:2017.6 business. The first bit (docker run) instructs docker to run a container. The next two flags (-i -t) tell docker to run the container interactively, and with a psuedo-TTY allocated. Next, this bit instructs docker to mount your current working directory to the container’s data directory as a volume (-v $(pwd):/data). Finally, the command ends with some info for docker run to know just what image we want to run - the 2017.6 tag of the qiime2/core image (qiime2/core:2017.6).

This strategy creates a new docker container for each qiime command you run, so you probably want to experiment with some of the docker run flags specific to container cleanup and housekeeping.

Strategy Two (interactive shell)

The other option is to launch a docker container, and then execute your qiime commands once you are working inside the container.

Again, starting with some example commands that you might want to run in qiime2:

$ qiime feature-table summarize \
  --i-table table.qza \
  --o-visualization table.qzv \
  --m-sample-metadata-file sample-metadata.tsv

$ qiime feature-table tabulate-seqs \
  --i-data rep-seqs.qza \
  --o-visualization rep-seqs.qzv

Crafting those to work in an interactive shell session in docker:

# First run the container, but ask `docker` to execute `/bin/bash`,
# instead of `qiime`
$ docker run -t -i -v $(pwd):/data qiime2/core:2017.6 /bin/bash

# Now the container is launched, and your shell prompt should
# actually be sitting inside of the running container
[email protected]:/data $ qiime feature-table summarize \
  --i-table table.qza \
  --o-visualization table.qzv \
  --m-sample-metadata-file sample-metadata.tsv

[email protected]09aeb:/data $ qiime feature-table tabulate-seqs \
  --i-data rep-seqs.qza \
  --o-visualization rep-seqs.qzv

Once you are done, type exit to quit out of the bash session, which will in turn halt the running docker container.

Wrap up

You mentioned not being able to see q2-types in the list of commands when you ran the qiime command, this is because q2-types doesn’t define any new commands, only types (that get used in other plugins that define their own commands). To see a full list of the installed and registered qiime2 plugins, please run qiime info!

I hope that helps! If you get stuck anywhere along the way please just let us know and we are more than happy to help!

3 Likes

One brief follow-up to this: you might need to experiment with the volume mounting parts of your docker commands to work with Docker Toolbox — I don’t have any immediate advice on that front, but I suspect you will need to make some adjustments specific to your installation and environment. Thanks!

1 Like

Thank you very much for the quick and detailed explanation! Really enjoyed learning about this. Both methods worked perfectly. I found the interactive shell to make a bit more sense, without having to pile up numerous containers and remembering to remove their file systems. Minor inconvenience really…
I’ll certainly play around with volume mounting parts but perhaps down the line this is something that can be addressed in the docker instructions as well. Thanks again!

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.