Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. Basic Commands for DockerFile:
  2.  
  3. FROM node:10
  4. WORKDIR /app
  5. COPY package.json /app
  6. RUN npm install
  7. COPY . /app
  8. EXPOSE 3000
  9. CMD npm start
  10.  
  11. Command to convert the node app to a docker image:
  12.  
  13. > docker build ./
  14. this will run the DockerFile and path of ./ or any PATH should point towards the DockerFile this will output the Image file.
  15.  
  16. We can give tags also which will be easy to identify the Docker Files
  17. > docker build ./ -t myapp
  18.  
  19. this will give output:
  20. Successfully built b1bff2dcdbc7
  21. Successfully tagged myapp:latest
  22.  
  23. check in docker images
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement