I want to create a Dockerfile that has node.js, here is my code:
FROM node:latest
WORKDIR /app
After executing the command docker build .
and checking my image with docker image
it says <none>
Any ideas?
I want to create a Dockerfile that has node.js, here is my code:
FROM node:latest
WORKDIR /app
After executing the command docker build .
and checking my image with docker image
it says <none>
Any ideas?
2
Answers
I understand what you are trying to do. However a little more detail would be nice.
To answer your question, you have at least two methods. The first method would be to tag the image like so:
docker build -t image_name .
This is probably the most basic and simplest way. However, if your building this image over and over, then you may want to use a second method, a docker-compose file, like so:
Inspiration for these examples taken from this SO question
If either of these work for you, please don’t forget to accept this answer.
Try with
*–tag , -t –> Name and optionally a tag in the ‘name:tag’ format