diff --git a/Laboratoire/Teaching-Docker-SimpleJavaServer b/Laboratoire/Teaching-Docker-SimpleJavaServer new file mode 160000 index 0000000..a9ca710 --- /dev/null +++ b/Laboratoire/Teaching-Docker-SimpleJavaServer @@ -0,0 +1 @@ +Subproject commit a9ca710e58c43c3584e3246a0c74eb615018885f diff --git a/README.md b/README.md index 9926c84..9118be7 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,25 @@ This is where you will find lecture notes, slides and some of the examples prese * Be ready for a challenging week * Understand and be able to explain the following concepts: * What is Docker? How are containers different from virtual machines? + + * What is the difference between the Docker CLI and the Docker engine? Why can we say that Docker is based on a client-server architecture? + * Docker Client : This is the utility we use when we run any docker commands e.g. docker run (docker container run) , docker images , docker ps etc. It allows us to run these commands which a human can easily understand. + * Docker Daemon/Engine: This is the part which does rest of the magic and knows how to talk to the kernel, makes the system calls to create, operate and manage containers, which we as users of docker dont have to worry about. + * What is the difference between a Docker image and a Docker container? + * Image are models to create the shape of a docker + * Docker is the instance create thank to the image * How does one create a Docker image? How does one create a Docker container? + * We have to build our own image with a Dockerfile with `docker run` + * Once we have the image we can create an instance of the image with `docker run` * What is Dockerhub? - * Be able to explain what happens when you type `docker run -it —rm alpine /bin/sh`. Be able to explain the meaning of every argument in this command. + * Docker Hub is a big library containings a lot of images private or publi + * Be able to explain what happens when you type `docker run -it —rm alpine /bin/sh`. + * i for interacitve, t for terminal, -rm is non-sens, run an instance of the image alpine, a lightweight linux + * Be able to explain the meaning of every argument in this command. * Be able to explain how port mapping works in Docker. Be able to explain how to use the `-p xx:yy`parameter when using `docker run`. + * -p Publish a container's port, or range of ports, to the host. : * Have been able to run the [demo 1](https://github.com/SoftEng-HEIGVD/Teaching-Docker-SimpleJavaServer) on one's laptop during the week. * Be able to perform the following operations * Write a Dockerfile to define an image that contains a TCP server written in Java diff --git a/examples/04-StreamingTimeServer/StreamingTimeServer/src/main/java/ch/heigvd/res/examples/StreamingTimeServer.java b/examples/04-StreamingTimeServer/StreamingTimeServer/src/main/java/ch/heigvd/res/examples/StreamingTimeServer.java index 46e5c39..4bce5e0 100644 --- a/examples/04-StreamingTimeServer/StreamingTimeServer/src/main/java/ch/heigvd/res/examples/StreamingTimeServer.java +++ b/examples/04-StreamingTimeServer/StreamingTimeServer/src/main/java/ch/heigvd/res/examples/StreamingTimeServer.java @@ -29,7 +29,7 @@ public class StreamingTimeServer { private final int TEST_DURATION = 15000; private final int PAUSE_DURATION = 1000; - private final int NUMBER_OF_ITERATIONS = TEST_DURATION / PAUSE_DURATION; + private final int NUMBER_OF_ITERATIONS = 1 ;//TEST_DURATION / PAUSE_DURATION; private final int LISTEN_PORT = 2205; /** @@ -67,6 +67,12 @@ public void start() { Thread.sleep(PAUSE_DURATION); } + while( reader.read() ){ + + } + + System.out.println("client dit : " + (char)reader.read()); + reader.close(); writer.close(); clientSocket.close(); diff --git a/examples/06-PresenceApplication/PresenceApplication/src/main/java/ch/heigvd/res/examples/PresenceClient.java b/examples/06-PresenceApplication/PresenceApplication/src/main/java/ch/heigvd/res/examples/PresenceClient.java index 4670146..230cc21 100644 --- a/examples/06-PresenceApplication/PresenceApplication/src/main/java/ch/heigvd/res/examples/PresenceClient.java +++ b/examples/06-PresenceApplication/PresenceApplication/src/main/java/ch/heigvd/res/examples/PresenceClient.java @@ -107,6 +107,4 @@ private void cleanup() { LOG.log(Level.SEVERE, ex.getMessage(), ex); } } - - } diff --git a/examples/06-PresenceApplication/PresenceApplication/src/main/java/ch/heigvd/res/examples/PresenceServer.java b/examples/06-PresenceApplication/PresenceApplication/src/main/java/ch/heigvd/res/examples/PresenceServer.java index 517a248..ee39ac2 100644 --- a/examples/06-PresenceApplication/PresenceApplication/src/main/java/ch/heigvd/res/examples/PresenceServer.java +++ b/examples/06-PresenceApplication/PresenceApplication/src/main/java/ch/heigvd/res/examples/PresenceServer.java @@ -207,7 +207,5 @@ private void disconnect() { connected = false; cleanup(); } - } - }