This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Can not use docker command in fenics

0 votes

Hi

I have been trying to create a shared folder using something like the command "docker run -ti -v $(pwd):/home/fenics/shared your_fenics_image" in docker with fenics running. I get the message ; "bash:docker: command not found". Does anyone know what the problem is?

asked Nov 29, 2016 by haakon555 FEniCS Novice (330 points)

1 Answer

0 votes

When you type docker run -it -v... IMG at your shell, docker runs the image IMG: this means that docker starts a linux virtual machine, whose disk image, config, etc is contained in IMG. You do this at the shell of your host machine.

The fenics image you are running doesn't know a word about docker, nor has an executable in it with that name.

Once you have run your image, you get a shell to it. This shell will have a prompt like fenics@a823742b. In docker terms, you have run the image to get a container holding the shell you are seeing.

This container / running image has a name, which you can see with the command docker ps (this again from the host computer). Container names are funny compositions of names of scientists and adjectives, like "outrageous_einstein" or whatever...

If you happen to exit the fenics shell or want another one, you use this name to run stuff in the same container: Again from your host computer, i.e. at its shell, type

docker exec -it -u fenics <container-name> /bin/bash

This can be used to start an ipython notebook, run scripts or whatever, all from the host computer.

answered Nov 30, 2016 by mdbenito FEniCS User (4,530 points)
...