diff --git a/docker-ubuntu/Dockerfile b/docker-ubuntu/Dockerfile new file mode 100644 index 00000000..deaa434d --- /dev/null +++ b/docker-ubuntu/Dockerfile @@ -0,0 +1,31 @@ +FROM dorowu/ubuntu-desktop-lxde-vnc:focal + +WORKDIR /root/project + +# Install dependencies +# See: https://github.com/cpp-io2d/P0267_RefImpl/blob/P0267R8/BUILDING.md +RUN apt update && \ + apt install -y build-essential && \ + apt install -y cmake && \ + apt install -y libcairo2-dev && \ + apt install -y libgraphicsmagick1-dev && \ + apt install -y libpng-dev && \ + apt install -y git + +# Install VS Code +# See: https://code.visualstudio.com/docs/setup/linux +RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg && \ + install -o root -g root -m 644 packages.microsoft.gpg /usr/share/keyrings/ && \ + sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list' && \ + apt-get install apt-transport-https && \ + apt-get update && \ + apt-get install code + +# Install IO2D +RUN git clone --recurse-submodules https://github.com/cpp-io2d/P0267_RefImpl && \ + cd P0267_RefImpl && \ + mkdir Debug && \ + cd Debug && \ + cmake --config Debug "-DCMAKE_BUILD_TYPE=Debug" .. && \ + cmake --build . && \ + make install \ No newline at end of file diff --git a/docker-ubuntu/README.md b/docker-ubuntu/README.md new file mode 100644 index 00000000..dc0fef8b --- /dev/null +++ b/docker-ubuntu/README.md @@ -0,0 +1,42 @@ +# Container environment + +This provides a Dockerfile which can be used to build a Docker image locally and run a container for the environment setup of this project. It is an Ubuntu environemt with an LXDE desktop, based on an [existing Docker image](https://hub.docker.com/r/dorowu/ubuntu-desktop-lxde-vnc/). The instructions on the Dockerfile install all the needed dependencies, including VS Code and IO2D. + +## Setup + +* Clone the project or your own fork: + +``` +git clone --recurse-submodules https://github.com/udacity/CppND-Route-Planning-Project +``` + +* Build the Docker image: + +```bash +docker build -t environment-cpp-project-1 . +``` + +* Run the Docker container, by mounting the project's directory from your host to the container: + +```bash +docker run -p 6080:80 -v /dev/shm:/dev/shm \ + -v :/root/project/CppND-Route-Planning-Project \ + environment-cpp-project-1 +``` + +* Open `http://localhost:6080/` on your browser to see the Ubuntu Desktop. + +* Open the terminal in Ubuntu to build and execute the project: + +```bash +cd /root/project/CppND-Route-Planning-Project +mkdir build +cd build +cmake .. +make +./OSM_A_star_search +``` + +You should see the output below and at this point can continue working locally on the project. + +![alt text](Ubuntu_Desktop.png "Ubuntu Desktop") \ No newline at end of file diff --git a/docker-ubuntu/Ubuntu_Desktop.png b/docker-ubuntu/Ubuntu_Desktop.png new file mode 100644 index 00000000..6c48e02a Binary files /dev/null and b/docker-ubuntu/Ubuntu_Desktop.png differ