From dd119562e4c26dba7f6c6eb7ff474b76906ec0a2 Mon Sep 17 00:00:00 2001 From: Taeber Rapczak Date: Wed, 8 Aug 2018 11:47:34 -0400 Subject: [PATCH 1/3] Changed the order of image and container removal. When I ran `docker rmi harry:potter`, I received an error stating the image was referenced by a container. Running `docker rm harry` beforehand, however, removes the container and allows for the initial command to execute successfully. --- module2.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module2.md b/module2.md index b4af71f..b11eb26 100644 --- a/module2.md +++ b/module2.md @@ -40,8 +40,8 @@ In this exercise you will become familiar with the docker commit command which a 7. Type ```docker images``` and note that you now see two images one name harry with a tag of latest and another named harry with a tag of potter 8. Type ```docker run -ti --name harry harry:potter``` and type ```ls``` to note that the ron_was_here.txt file is in the new container 9. Type exit -10. Type ```docker rmi harry:potter``` -11. Type ```docker rm harry``` +10. Type ```docker rm harry``` +11. Type ```docker rmi harry:potter``` Although this example is simple the idea here is to see how you take a container, add new configurations to it and make and image from it to be used in other containers. However, as useful as docker commit is ultimately you will most likely use it rarely and instead will favor the Dockerfile process to build your images. Using docker commit is typically a one time process where you have to create the first container to make the next image. A Dockerfile is a more consistent way to make repeatable images or new images with changes to the Dockerfile options. From 5789c0c513c07c64edf5b10adba185377b7bc072 Mon Sep 17 00:00:00 2001 From: Taeber Rapczak Date: Wed, 8 Aug 2018 13:50:32 -0400 Subject: [PATCH 2/3] Added assignment --- build3/Dockerfile | 6 ++++++ build3/main.go | 7 +++++++ 2 files changed, 13 insertions(+) create mode 100644 build3/Dockerfile create mode 100644 build3/main.go diff --git a/build3/Dockerfile b/build3/Dockerfile new file mode 100644 index 0000000..53d2bf6 --- /dev/null +++ b/build3/Dockerfile @@ -0,0 +1,6 @@ +FROM golang:1.8 + +ADD . /go/src/app + +CMD ["go", "run", "/go/src/app/main.go"] + diff --git a/build3/main.go b/build3/main.go new file mode 100644 index 0000000..f7b60bd --- /dev/null +++ b/build3/main.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func main() { + fmt.Println("Hello, world!") +} From 2fe5d77f8f70d07d21c9fc1e61e10cb317ffd92d Mon Sep 17 00:00:00 2001 From: Taeber Rapczak Date: Wed, 8 Aug 2018 13:50:56 -0400 Subject: [PATCH 3/3] Changed base image from ubuntu to debian. With ubuntu, apt-get install net-tools failed for some reason. Might be temporary. --- build5/curlcontainer2/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build5/curlcontainer2/Dockerfile b/build5/curlcontainer2/Dockerfile index 9e2346a..2bdf8e9 100644 --- a/build5/curlcontainer2/Dockerfile +++ b/build5/curlcontainer2/Dockerfile @@ -1,6 +1,6 @@ -FROM ubuntu +FROM debian:stretch -RUN apt-get update && apt-get install -y \ +RUN apt-get update -y && apt-get install -y \ curl \ pv \ iputils-ping \