forked from fjammes/tuto-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Slides: http://pointful.github.io/docker-intro/#/ |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
# cat /proc/meminfo | ||
|
||
serverCount=10 | ||
startDate=$(date) | ||
for n in $(seq 1 1 $serverCount) | ||
do | ||
hostPort=$(($n + 10000)) | ||
provider="World #$n" | ||
echo "Starting $n. Host Port: $hostPort, Message: $provider" | ||
docker run -d -p $hostPort:5000 -e "PROVIDER=$provider" training/webapp | ||
done | ||
echo | ||
echo Started $n containers. Start time: $startDate, end time: $(date) | ||
|
||
# Stop all: docker stop $(docker ps -q) | ||
# Remove all stopped: docker rm $(docker ps -aq) | ||
|
||
# Test run: | ||
# free –m: 1494 | ||
# 1 Container: 1480 | ||
# 100 Containers: 124 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# A Dockerfile is a simple text-file that contains a list of commands | ||
# that the Docker client calls while creating an image. | ||
# It's a simple way to automate the image creation process. | ||
# The best part is that the commands you write in a Dockerfile are almost | ||
# identical to their equivalent Linux commands. This means you don't really | ||
# have to learn new syntax to create your own dockerfiles. | ||
|
||
# Use ubuntu as base image, it will be downloaded automatically | ||
FROM ubuntu:latest | ||
MAINTAINER Jacques Celere "jacques.celere@gmail.com" | ||
|
||
# Update and install python-3 | ||
RUN xxxx | ||
|
||
# Create /home/www | ||
RUN xxxx | ||
|
||
# Set /home/www as WORKDIR | ||
WORKDIR xxxx | ||
|
||
# Copy index.html inside container, in /home/www | ||
# NOTE: code could also be retrieved from git repository | ||
ADD xxxx | ||
|
||
# Copy hello.py inside container, in /home/src | ||
# NOTE: putting this command to the last line | ||
# would allow to rebuild only this layer if if hello.py is changed | ||
ADD xxxx | ||
|
||
# Launch /home/src/hello.py at container startup | ||
# It will serve files located where it has been launch | ||
CMD xxxx | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import http.server | ||
import socketserver | ||
|
||
PORT = 8000 | ||
|
||
Handler = http.server.SimpleHTTPRequestHandler | ||
|
||
httpd = socketserver.TCPServer(("", PORT), Handler) | ||
|
||
print("serving at port", PORT) | ||
httpd.serve_forever() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Hello World |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Hello, I'm on host machine! |
File renamed without changes.