DEV Community

Discussion on: Learn Docker - from the beginning, part I images and containers

Collapse
andy1 profile image
Andy

If anyone gets a syntax error in their IDE in the app.js code that says "'import' is only available in ES6 (use 'esversion: 6')," follow these instructions: stackoverflow.com/questions/363188...

Collapse
andy1 profile image
Andy

The Docker exec command has to be done on a RUNNING container

Collapse
softchris profile image
Chris Noring Author

fair point Andy. I've updated the text, thanks :)

Collapse
andy1 profile image
Andy • Edited on

Another note: when you get to the step where you build your first image, the command would be more accurately described as:

docker build -t YOUR_DOCKER_USERNAME/THE_OS_YOU_SELECTED .

Collapse
softchris profile image
Chris Noring Author

well the tagging is pretty much up to you it could be chris/node-web-app. You are right though that you need to name it in a specific way when you tag it for the container registry for Azure for example dev.to/azure/learn-how-you-can-bui... for your container registry to accept it. I'm sure that's true for AWS as well

Thread Thread
andy1 profile image
Andy

Sweet, thanks!

Collapse
andy1 profile image
Andy

Yet another note: the tutorial doesn't include instructions on how to stop running your container. There has to be a better way than this, but I had to open a new Terminal tab, find the ID of my container by running

docker container ls

. I copied and pasted the id and then ran

docker container stop [ID]

Collapse
softchris profile image
Chris Noring Author

actually, you can run docker ps to get a list of running containers. Then you can find out both name and id, either is good when you try to stop it next which you do with docker stop [id or name]. Usually, you only need the first 2-3 characters of the id

Collapse
andy1 profile image
Andy

Realized this is addressed later in the tutorial, yay :)

Collapse
vp31 profile image
vp-31

to view containers running:
docker ps
to view all created containers:
docker ps -a

Collapse
andy1 profile image
Andy

When you run

docker build -t [YOUR STUFF]

NOTE: the -t flag stands for 'tag.' According to the Docker documentation:
--tag , -t: Name and optionally a tag in the ‘name:tag’ format