LatestProject Management for Web Applications

Containers using Docker

A state-of-the-art of container virtualizaion is DOCKER.

This gives an efficient way to host multiple “services” without installing them on your local machine.

Some command snippets

in docker “tags” are used to specify variants and versions

Images

docker image list
docker images
docker pull <image-name>:<image-tag>

Execute / start container

docker run -d {image}:{version}
docker run --detached {image}:{version}

docker run -d
   -p {exposed-port}:{container-port}
   --name {container-name}
   -e {env-variable}={env-value}
   {image}:{ver}

Monitor, stop, restart

docker logs {container-id}
docker stop {container-id}
docker restart {container-id}

Example

nmp install express --save
node src/server.js
docker build  -t {name}:{tag} {DockerFile-Dir}
docker build -t my-node-app:1.0 .
docker run -d 
  -p 3000:3000
  --name node-app-v1_0
  my-node-app:1.0

Leave a Reply