Dockerfile:
FROM node:latest
MAINTAINER Rodrigo Santos
ENV NODE_EMV=production
ENV PORT=3000
COPY . /var/www
WORKDIR /var/www
RUN npm install
ENTRYPOINT ["npm", "start"]
EXPOSE $PORT
Quando rodo o comando de build:
docker build -f Dockerfile -t rodrigosantos/node .
O terminal fica parado na etapa 7:
Sending build context to Docker daemon 6.144kB
Step 1/9 : FROM node:latest
---> 6dc0a5fbad51
Step 2/9 : MAINTAINER Rodrigo Santos
---> Using cache
---> cccefc53a154
Step 3/9 : ENV NODE_EMV=production
---> Using cache
---> 3765389eaf93
Step 4/9 : ENV PORT=3000
---> Using cache
---> 936551f5a99e
Step 5/9 : COPY . /var/www
---> Using cache
---> 439c2585f536
Step 6/9 : WORKDIR /var/www
---> Using cache
---> d47697baaba8
Step 7/9 : RUN npm install
---> Running in 9d8bea14f9b5
Após parar o terminal e rodar o comando para listar as imagens:
docker images
Retorna a imagem criada mas sem nome:
REPOSITORY TAG IMAGE ID CREATED SIZE
<none> <none> 2b84b379a1ea 2 hours ago 992MB
docker latest 0c655f708b2a 8 days ago 216MB
node latest 6dc0a5fbad51 9 days ago 992MB
ubuntu latest ba6acccedd29 5 weeks ago 72.8MB
dockersamples/static-site latest f589ccde7957 5 years ago 191MB