![]() This is typical log data that could be recorded on an actual web site to monitor which pages are most accessed. Note: This will immediately bring a table in the page, while at the same time you may notice that on the Terminal some information of what page(s) have been loaded appear. Start new, detached container with shared folder. Typical example mapped port names could be: 8080, 8787, 8888. ![]() p, -publish list Publish a container's port(s) to the host. Port mapping: ( -p) We’ll map the relevant port ( port 80) to a port number of our own choosing with the -p (lower case) option.The folder /data will be created within the container and share all files from the dedicated host folder e.g. Shared folder: ( -v) this provides a channel of communication for data exchange between the container and the host file system.Name: ( -name) as above we’ll specify a name of our choosing to designate the container.d will allow the shell prompt back, in effect placing the container processes in the background. This can be changed and the container can be made to run in the background with the “detach” modifier as detailed in help: -d, -detach Run container in background and print container ID. Detached terminal: ( -d) In the previous tests we had to use a secondary terminal because the prompt was not given back after launching the container.With this final, complete command we’ll address useful or necessary points. We’ll see shortly that this can be very useful to run specific web-based software.įrom this alternative terminal we can also see information about running containers with: Summary: we were able to start a container running a web site and accessing the site from a browser running on the local computer. The random aspect of -P means that the number on the local host might not be always the same. Note: Adapt the port number to what you will see on your own terminal. Therefore you should be able to see the content of the web site in the container with the following web address with a web browser on your computer: In this example we see that port 80 which we saw earlier is the standard default port number for a web server is mapped to port 32777 which means that port 80 of the container would be connected to port 32777 on the local host (the computer you are using.) ( Note: We could also see this information with docker ps under the PORTS column as shown below.)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |