diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..4d68d77 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,20 @@ +# .dockerignore +# +# Created on Wed Nov 15 2023 by Florian Pfleiderer +# +# Copyright (c) 2023 TU Wien + +# Ignore .github directory +.github + +# Ignore build directory +build + +# Ignore LICENSE.md file +LICENSE.md + +# Ignore README.md file +README.md + +# Ignore .gitignore file +.gitignore diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..280261f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,47 @@ +# Dockerfile +# +# Created on Wed Nov 15 2023 by Florian Pfleiderer +# +# Copyright (c) 2023 TU Wien + +FROM gcc:latest AS build + +# Install necessary tools +RUN apt-get update && \ + apt-get install -y \ + build-essential \ + cmake \ + git + +# Install dependencies +RUN apt-get update && \ + apt-get install -y \ + libgl1-mesa-dev \ + libglfw3-dev \ + libxinerama-dev \ + libxcursor-dev \ + libxi-dev \ + libasound2-dev \ + doxygen \ + openssh-server \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /simplesynth + +COPY . . + +WORKDIR /simplesynth/build + +RUN cmake .. && make + +WORKDIR /simplesynth + +# Configure SSH +# RUN mkdir /var/run/sshd +# RUN echo 'root:password' | chpasswd +# RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config + +#expose ssh port +# EXPOSE 22 + +CMD [ "/bin/bash" ] \ No newline at end of file diff --git a/README.md b/README.md index e597685..1bda9e7 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,14 @@ Clone: git clone https://stea.iue.tuwien.ac.at/CppProjects2023/GroupKProject ``` ### Build +#### using docker +``` +docker built -t simplesynth . +docker run -it --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix simplesynth +``` + +If you want to run it on mac, see: https://medium.com/@nr817174/gui-containers-on-docker-running-graphical-applications-seamlessly-36e77925d0df + #### macos ``` mkdir build