You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// CSANAD: Just a note: this output is slightly smaller and faster compared to when
656
+
// the reader first runs the `docker build`.
657
+
647
658
Now we can see our image in the list of docker images on the system:
648
659
649
660
[subs="specialcharacters,quotes"]
@@ -812,6 +823,14 @@ TIP: Forgetting the `-r` and running `pip install requirements.txt`
812
823
because (at the time of writing), it's not very self-explanatory.
813
824
And it's a mistake I still make, _all the time_.
814
825
826
+
// CSANAD: This is no longer true, the error message is very helpful by now:
827
+
//
828
+
// $ pip install requirements.txt
829
+
// ERROR: Could not find a version that satisfies the requirement requirements.txt (from versions: none)
830
+
// HINT: You are attempting to install a package literally named "requirements.txt" (which cannot exist). Consider using the '-r' flag to install the packages listed in requirements.txt
831
+
// ERROR: No matching distribution found for requirements.txt
832
+
833
+
815
834
816
835
==== Successful run
817
836
@@ -862,7 +881,14 @@ WARNING: Make sure you use the `-it` flags to the Docker `run`
862
881
to be run in an interactive terminal session,
863
882
otherwise you'll get strange behaviours, including not being able
864
883
to interrupt the docker process with _Ctrl-C_.
865
-
884
+
In case it already happened, you can terminate it using
885
+
`docker stop <container_id>`.
886
+
Also, it's worth mentioning that you can specify just enough characters
887
+
of the container ID that uniquely identifies the container - e.g. if you
888
+
have a container with the ID `abcdef123456` and no other container ID
889
+
starts with `a`, you can use just `a` to reference this container in your
890
+
Docker commands:
891
+
`docker stop a`.
866
892
867
893
868
894
@@ -887,12 +913,15 @@ Nope! What's going on here? Time for a little debugging.
887
913
888
914
=== Debugging a Container Networking Problems
889
915
890
-
First let's try and take a look ourselves, in our browser:
916
+
First let's try and take a look ourselves, in our browser. Let's visit http://localhost:8888/:
891
917
892
918
[[firefox-unable-to-connect-screenshot]]
893
919
.Cannot connect on that port
894
920
image::images/firefox-unable-to-connect.png["Firefox showing the 'Unable to connect' error"]
895
921
922
+
// CSANAD: Some more specific instructions were missing. We didn't specify the address.
923
+
// Based on the following text I think it's supposed to be
924
+
// http://localhost:8888 here but of course, it would fail with any other port as well.
896
925
897
926
Now let's take another look at the output from our `docker run`. Here's what appeared right at the end:
898
927
@@ -903,8 +932,10 @@ Starting development server at http://127.0.0.1:8000/
903
932
Quit the server with CONTROL-C.
904
933
----
905
934
906
-
Aha! We notice that we're using the wrong port, `8000` instead of the `8888`
935
+
Aha! We notice that we're using the wrong port, the default `8000` instead of the `8888`
907
936
that we specified in the `TEST_SERVER` env var.
937
+
// CSANAD: since we haven't specified :8000 explicitly either, maybe this sentence is
938
+
// clearer with this extra word "default".
908
939
909
940
Let's fix that by amending the `CMD` instruction in the Dockerfile:
0 commit comments