Skip to content

info-aliahmadi/hello-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

How to create a simple image in Docker

This simple project show you how to create a simple image of the project by docker commands.

Installation

after installing Docker on your machine then follow this instructions:

1. Clone the project

2. Open the powershell

3. Go to the project directory

4. Write this command:

/> docker build -t hello-docker .

After that the image created and you can sure about that by this command:

/> docker images

5. Then run the image by this command:

/> docker run hello-docker

Describe the Dockerfile

Any project that wants to be Dockerized needs this file.

FROM node:alpine  
COPY . /app
WORKDIR /app
CMD node app.js

FROM: What container your project need to run or build

COPY: Copy all contents from root folder to 'app' folder in image's filesystem

WORKDIR: Go to 'app' directory for run commands

CMD: run the "node app.js" command

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors