From bccbb704b6b9697cdfa6d783f18c53655516a3d9 Mon Sep 17 00:00:00 2001
From: GitHub Actions Edit
"creativeWorkStatus": "active",
"url": "https://preview.carpentries.org/docker-introduction/06-containers-on-the-cloud.html",
"identifier": "https://preview.carpentries.org/docker-introduction/06-containers-on-the-cloud.html",
- "dateCreated": "2024-08-01",
+ "dateCreated": "2024-08-16",
"dateModified": "2024-07-31",
"datePublished": "2024-08-16"
}
diff --git a/08-orchestration.html b/08-orchestration.html
index 3b928e9c..85e53d2e 100644
--- a/08-orchestration.html
+++ b/08-orchestration.html
@@ -470,7 +470,7 @@
The Wild WestPage not found
"creativeWorkStatus": "active",
"url": "https://preview.carpentries.org/docker-introduction/404.html",
"identifier": "https://preview.carpentries.org/docker-introduction/404.html",
- "dateCreated": "2024-08-01",
+ "dateCreated": "2024-08-16",
"dateModified": "2024-08-16",
"datePublished": "2024-08-16"
}
diff --git a/CODE_OF_CONDUCT.html b/CODE_OF_CONDUCT.html
index be5aa772..75902769 100644
--- a/CODE_OF_CONDUCT.html
+++ b/CODE_OF_CONDUCT.html
@@ -420,7 +420,7 @@
Contributor Code of Conduct
"creativeWorkStatus": "active",
"url": "https://preview.carpentries.org/docker-introduction/CODE_OF_CONDUCT.html",
"identifier": "https://preview.carpentries.org/docker-introduction/CODE_OF_CONDUCT.html",
- "dateCreated": "2024-08-01",
+ "dateCreated": "2024-08-16",
"dateModified": "2024-07-31",
"datePublished": "2024-08-16"
}
diff --git a/LICENSE.html b/LICENSE.html
index 023b015d..a1d15469 100644
--- a/LICENSE.html
+++ b/LICENSE.html
@@ -471,7 +471,7 @@ Licenses
"creativeWorkStatus": "active",
"url": "https://preview.carpentries.org/docker-introduction/LICENSE.html",
"identifier": "https://preview.carpentries.org/docker-introduction/LICENSE.html",
- "dateCreated": "2024-08-01",
+ "dateCreated": "2024-08-16",
"dateModified": "2024-07-31",
"datePublished": "2024-08-16"
}
diff --git a/about.html b/about.html
index a3a21bc2..b0d2557f 100644
--- a/about.html
+++ b/about.html
@@ -413,7 +413,7 @@ About
"creativeWorkStatus": "active",
"url": "https://preview.carpentries.org/docker-introduction/about.html",
"identifier": "https://preview.carpentries.org/docker-introduction/about.html",
- "dateCreated": "2024-08-01",
+ "dateCreated": "2024-08-16",
"dateModified": "2024-07-31",
"datePublished": "2024-08-16"
}
diff --git a/advanced-containers.html b/advanced-containers.html
index 3589d2a0..80175941 100644
--- a/advanced-containers.html
+++ b/advanced-containers.html
@@ -421,24 +421,61 @@ BASHsum.py. Let’s say we wanted to try running the
script using a container based on our recently created
alpine-python
container image.
If we try running the container and Python script, what happens?
+We can run a container from the alpine-python container image +using:
$ docker container run alice/alpine-python python3 sum.py
+$ docker container run alice/alpine-python
+What happens? Since the Dockerfile
that we built this
+container image from had a CMD
entry that specified
+["python3", "--version"]
, running the above command simply
+starts a container from the image, runs the
+python3 --version
command and exits. You should have seen
+the installed version of Python printed to the terminal.
Instead, if we want to run an interactive Python terminal, we can use
+docker container run
to override the default run command
+embedded within the container image. So we could run:
The -it
tells Docker to set up and interactive terminal
+connection to the running container, and then we’re telling Docker to
+run the python3
command inside the container which gives us
+an interactive Python interpreter prompt. (type exit()
+to exit!)
If we try running the container and Python script, what happens?
+What does the error message mean? Why might the Python inside the -container not be able to find or open our script?
+Question: What does the error message mean? Why might the Python +inside the container not be able to find or open our script?
+This question is here for you to think about - we explore the answer +to this question in the content below.
Let’s try running the command now:
-$ docker container run --mount type=bind,source=${PWD},target=/temp alice/alpine-python python3 sum.py
+$ docker container run --mount type=bind,source=${PWD},target=/temp alice/alpine-python python3 sum.py
But we get the same error!
/temp
– so we
need to include that in the path to the script. This command should give
us what we need:
-$ docker container run --mount type=bind,source=${PWD},target=/temp alice/alpine-python python3 /temp/sum.py
+$ docker container run --mount type=bind,source=${PWD},target=/temp alice/alpine-python python3 /temp/sum.py
Note that if we create any files in the /temp
directory
while the container is running, these files will appear on our host
@@ -562,12 +601,12 @@