66 lines
2.7 KiB
TeX
66 lines
2.7 KiB
TeX
\chapter{Local Docker}
|
|
\ChapterLabel{LocalDocker}
|
|
\index{Docker}
|
|
\index{Docker!local environment}
|
|
|
|
For this assignment, I installed Docker and ran the two example websites
|
|
described in Sections~2.5 and~2.6 of the \textit{dsoDockerSetup} document.
|
|
Both websites ran inside Docker containers on my local computer. I verified
|
|
them by opening their loopback addresses in a web browser.
|
|
|
|
\section{Local Website Endpoints}
|
|
The two local addresses used for verification were:
|
|
|
|
\begin{minted}[linenos=false]{text}
|
|
http://127.0.0.1:5050
|
|
http://127.0.0.1:8080
|
|
\end{minted}
|
|
|
|
The loopback address \texttt{127.0.0.1} limits access to the local computer.
|
|
The port number identifies which containerized website the browser should
|
|
open.
|
|
|
|
\section{Hello World Website}
|
|
The first Docker example displayed the message ``Hello, World from Node +
|
|
Docker!'' at \texttt{http://127.0.0.1:5050}. The visible page confirms that
|
|
the website responded through the local port published for its container.
|
|
|
|
\begin{figure}[p]
|
|
\centering
|
|
\includegraphics[width=\textwidth]{prism-uploads/hello-world-screenshot.pdf}
|
|
\caption{Hello World website running locally in a Docker container on port 5050.}
|
|
\label{Figure:LocalDockerHelloWorld}
|
|
\end{figure}
|
|
|
|
\section{Color Buttons Website}
|
|
The second Docker example displayed a page titled ``Click a Button to Change
|
|
Background'' at \texttt{http://127.0.0.1:8080}. The screenshot shows the
|
|
Blue and Red controls and a blue page background, confirming that the
|
|
interactive website loaded through the local port published for its
|
|
container.
|
|
|
|
\begin{figure}[p]
|
|
\centering
|
|
\includegraphics[width=\textwidth]{prism-uploads/color-buttons-screenshot.pdf}
|
|
\caption{Color Buttons website running locally in a Docker container on port 8080.}
|
|
\label{Figure:LocalDockerColorButtons}
|
|
\end{figure}
|
|
|
|
\section{Results}
|
|
Table~\ref{Table:LocalDockerResults} summarizes the observed results. The
|
|
screenshots document the browser-visible results; they do not expose
|
|
passwords, tokens, or other secrets.
|
|
|
|
\begin{tabularx}{\linewidth}{L{3.2cm}L{3.8cm}Y}
|
|
\caption{Local Docker Website Results\label{Table:LocalDockerResults}}\\
|
|
\toprule
|
|
\textbf{Example} & \textbf{Local address} & \textbf{Observed result}\\ \midrule
|
|
Hello World & \texttt{127.0.0.1:5050} & The browser displayed ``Hello, World from Node + Docker!'' as shown in Figure~\ref{Figure:LocalDockerHelloWorld}.\\
|
|
Color Buttons & \texttt{127.0.0.1:8080} & The browser displayed the color-selection page with Blue and Red buttons as shown in Figure~\ref{Figure:LocalDockerColorButtons}.\\
|
|
\bottomrule
|
|
\end{tabularx}
|
|
|
|
Both examples were successfully accessible from the local browser at their
|
|
assigned ports. This demonstrated that Docker could run the two web
|
|
applications in containers and publish each application to a separate local
|
|
port. |