thiagoralves / OpenPLC_v2

OpenPLC with the new IEC ST to C compiler
http://www.openplcproject.com
GNU General Public License v3.0
189 stars 108 forks source link

Add Dockerfile for building docker images #2

Closed jseed closed 7 years ago

jseed commented 7 years ago

Been playing around with OpenPLC_v2 and I managed to get it to build/run in a Docker container.
This is great for the use case I am looking into as it makes it super portable and easy to spin up plc's on the fly.

If you are unfamiliar with Docker, let me know and I can post detailed instructions for building and running the image.

If you decide to incorporate this pr, let me know where/what documentation should be updated and I can throw up another commit.

I have pushed the container to a dockerhub repository as jseed/openplc, for ease of access.
I have yet to test it on any platform other than Docker for windows.

The container needs to be run in privileged mode to allow for the realtime thread priority, and with the appropriate ports open. Sample run command:

docker run -d --privileged -p 8080:8080 -p 502:502 jseed/openplc