Skip to content

coder-vulnerable/docker-node-fun

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-node-fun

Build Status GitHub version

Fooling around with Docker and Node.js.

Building and Running

The bin/run script builds and runs the program.

$ bin/run

The following explains what the bin/run script does at a high level. The actual script is more complex.

Building

The -t flag tags the image so it is easier to find using the docker images command. See The misunderstood Docker tag: latest.

$ docker build -t $USER/docker_node_fun .
$ # Manually provide a monotonically increasing tag number (from 1)
$ docker tag $USER/docker_node_fun $USER/docker_node_fun:1

The new image should now be visible:

$ docker images | grep docker_node_fun
mslinn/docker_node_fun           1                     015ab51e9d36        About a minute ago   676MB
mslinn/docker_node_fun           latest                015ab51e9d36        About a minute ago   676MB

Running

Run the app:

$ docker run -d $USER/docker_node_fun

Get the container ID:

$ CONTAINER_ID=$(docker ps -l | tail -n 1 | cut -d ' '  -f1)

View app output:

$ docker logs $CONTAINER_ID
Hello, world

About

Goofing around with Node.js running in Docker containers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 79.2%
  • Dockerfile 15.1%
  • JavaScript 5.7%