I have this Dockerfile:
FROM ubuntu:16.04
I run
docker build -t mine .
It builds. Then I run
docker exec -it mine /bin/bash
and it says
Error: No such container: mine
I'm sure I'm missing something simple, but I've Googled for docker image name, I've run docker images and it shows the "CONTAINER ID" "mine" (with tag "latest"), I've looked at stackoverflow. This is so basic it's hard to find the answer.
I'm running docker 19.03.2, build 6a30dfc, on OS X.
EDIT: If I run docker run mine it runs and immediately exits (of course, since that's what the Dockerfile says). Then there's a container (not running). Then if I exec that container by id, it says, "Container ..hex.. is not running," which makes sense.
I guess I want the simplest way to run a bash shell in Ubuntu 16.04.
Advice?
docker run --rm -ti containernamepossibly followed by a command, possibly with mount or port options etc pp. Dodocker imagesto see under what name your build succeeded.docker run --rm -ti ubuntu:16.04which will startbashby default.