Giter VIP home page Giter VIP logo

hello-world's Introduction

  hello, world

Build Status Docker Hub

  

Table of Contents

  

Description

Containers Training: Hands-on introduction to Docker and CI/CD.

  

Documentation

Start here and there.

  

Lab

monolith

# Install Node.js
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
git clone https://github.com/ArtiomL/hello-world.git
cd hello-world
# Install dependencies
npm install
# Run
node index.js &
# Test and crash the app
curl http://127.0.0.1:8080/app
curl http://127.0.0.1:8080/kill
curl http://127.0.0.1:8080/app
# Restore snapshot

 

usermod

# Install Docker CE
curl -fsSL https://get.docker.com | sh
# Manage Docker as a non-root user
sudo usermod -aG docker $USER
# Log out and log back in so that your group membership is re-evaluated

 

build

git clone https://github.com/ArtiomL/hello-world.git
cd hello-world
# Build an image from a Dockerfile
docker build -t hello-world .
# List images
docker images

 

pull

# Pull an image or a repository from a registry
docker pull artioml/hello-world

 

run

docker run -dit -p 80:8080 artioml/hello-world
# List running containers
docker ps
# Display listening server sockets (note docker-proxy)
sudo netstat -lnp | grep ':::80'
# Test and crash the app
curl http://127.0.0.1/app
curl http://127.0.0.1/kill
curl http://127.0.0.1/app
# Run again and assign a name
docker run -dit -p 80:8080 --name dhw artioml/hello-world

 

logs

# Fetch the logs of a container (follow output)
docker logs -f dhw

 

exec

# Run a command (as root) in a running container
docker exec -it -u 0 dhw /bin/sh
# Update the app
sed -i 's/Node.js app/Node.js app v2.0/' index.js
exit

 

diff

# Inspect changes to files or directories on a container's filesystem
docker diff dhw

 

commit

# Create a new image from a container's changes
docker commit dhw artioml/hello-world:2.0

 

push

docker images
# Log in to a Docker registry
docker login -u <user> -p <password>
# Push an image to a registry
docker push artioml/hello-world:2.0

 

rm

# Remove a container
docker rm -f dhw
# Run (new version) and restart if the container exits with a non-zero exit status
docker run -dit -p 80:8080 --name dhw --restart on-failure artioml/hello-world:2.0
# Test and crash the app
curl http://127.0.0.1/app
curl http://127.0.0.1/kill
docker ps
curl http://127.0.0.1/app
docker logs -f dhw

 

top

# Display the running processes of a container (note UID)
docker top dhw

 

stats

# Display a live stream of container(s) resource usage statistics
docker stats dhw

 

kill

# Kill one or more running containers
docker kill dhw

 

-P, --publish-all

# Publish all exposed ports to random ports (multiple instances)
for i in {1..3}; do
	docker run -ditP artioml/hello-world:2.0
done
# List running containers and examine the ports
docker ps
# Display listening server sockets (note docker-proxy)
sudo netstat -lnp | grep ':::32'

  

Next

hello-world's People

Contributors

artioml avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.