diff --git a/Web Pages/blog_docker.html b/Web Pages/blog_docker.html
index 2ffc548..e0c2988 100644
--- a/Web Pages/blog_docker.html
+++ b/Web Pages/blog_docker.html
@@ -27,7 +27,7 @@
- Updated on March 17, 2020
+ Updated on March 18, 2020
@@ -38,7 +38,7 @@
- Throughout my college career in computer science, I have found the need to develop applications that will be deployed in a Linux environment. As a windows user, I have usually turned to a couple of different options: virtual machines, Windows Subsystem for Linux, or Cygwin. Recently, I discovered an alternative method for building and testing Linux apps that is especially useful for collaboration and deployment. Docker allows you to package an OS and all the necessary dependencies into a docker image. You can then spin up an instance of this image called a docker container in which you can run your source code. The video below was incredibly helpful in my understanding of what docker is, how it's different from virtual machines, and how to use it.
+ Throughout my college career in computer science, I have found the need to develop applications that will be deployed in a Linux environment. As a windows user, I have usually turned to a couple of different options: virtual machines, Windows Subsystem for Linux, or Cygwin. Recently, I discovered an alternative method for building and testing Linux apps that is especially useful for collaboration and deployment. Docker allows you to package an OS and all the necessary dependencies into a docker image. You can then spin up an instance of this image called a docker container in which you can run your source code. Jake Wright's video was incredibly helpful in my understanding of what docker is, how it's different from virtual machines, and how to use it.
@@ -47,7 +47,7 @@
-
Installing Docker
+
Depending on your host machine's operating system, you will install one of the following Docker products. If you have macOS or Windows, your first option should be Docker Desktop. Check if you meet the system requirements. If you do not, Docker Toolbox is the legacy option that uses Oracle VirtualBox rather than Hyper-V or HyperKit for virtualization. I am using a computer with Windows 10 Home, so I use Docker Toolbox for Windows. This blog post will discuss some solutions to edge-case issues with Docker Toolbox that Docker Desktop users will hopefully not have to deal with.
@@ -108,15 +108,68 @@
-
Building Images & Running Containers
+
- To learn about Dockerfiles and a basic example, check out the video in the introduction. To learn about Docker Compose, check out the video below.
+ To learn about Dockerfiles and a basic example, check out the video in the introduction. To learn about Docker Compose, check out Jake Wright's video on the topic.
+
+
+
+ In a virtual machine, you can easily run GUI applications such as a web browser, text editor, etc. In a docker container, the process is a little bit different. You will need to download an X Server such as VcXsrv Windows X Server. If you are using Chocolatey, you can run choco install vcxsrv
.
+
+
+ Run GUI app in linux docker container on windows host provides a great explanation of why you would want to do this and how to run your docker container. The post discusses how to set your IP address as the DISPLAY
environment variable that is passed to docker via the -e DISPLAY=$DISPLAY
command line argument. You can alternatively pass your IP address as an environment variable in your docker compose file. This is shown in MAAV's ROS Tutorial (reproduced below). The main settings to look at below are environment
and network_mode
. Set the DISPLAY
environment variable to [ip_address]:0.0
and set network_mode: "host"
.
+
+
+
+# docker-compose.yml
+version: "2"
+
+services:
+ros-demo:
+ image: ros-demo
+ privileged: true
+ volumes:
+ # Mount the current directory do everything in /tutorial within docker
+ - .:/tutorial:rw
+ environment:
+ - DISPLAY=1.1.1.1:0.0 # Change 1.1.1.1 to your IP Address
+ network_mode: "host"
+ container_name: ros-demo
+ command: "/bin/bash --init-file scripts/source-ros.sh" #source ros automatically
+
+
+
+
+
+
+
+
+ - System Prune to clear space on Docker Machine
+
+ docker system prune --volumes
+
+
+ - Use Docker Compose to run a container named container_name
+
+ docker-compose run --rm container_name
+
+
+
+
+
+
+
+
+ Hopefully by this point, you have a better understanding of what docker is, why you might want to use it, and how to get a docker machine setup so you can build and run docker containers. If you have any questions or suggestions for improvement, feel free to contact me.
+
+
+