1 | FROM ubuntu:18.04
|
---|
2 | MAINTAINER Arunkumar Palanisamy "arunkumar.palanisamy@liu.se"
|
---|
3 | RUN apt-get update
|
---|
4 |
|
---|
5 | RUN apt-get install -y sudo gnupg lsb-release wget
|
---|
6 |
|
---|
7 | RUN for deb in deb deb-src; do echo "$deb http://build.openmodelica.org/apt `lsb_release -cs` nightly"; done | sudo tee /etc/apt/sources.list.d/openmodelica.list
|
---|
8 | RUN wget -q http://build.openmodelica.org/apt/openmodelica.asc -O- | sudo apt-key add -
|
---|
9 |
|
---|
10 | # Update index (again)
|
---|
11 | RUN apt-get update
|
---|
12 |
|
---|
13 | # Install minimal OpenModelica Components
|
---|
14 | RUN apt-get install -y omc omlib-modelica-3.2.2
|
---|
15 |
|
---|
16 | RUN apt-get install -y git
|
---|
17 |
|
---|
18 | # instal python3-pip
|
---|
19 | RUN apt-get install -y python3-pip
|
---|
20 |
|
---|
21 | RUN pip3 install --upgrade pip
|
---|
22 |
|
---|
23 | # Install OMPython
|
---|
24 | RUN pip3 install -U git+https://github.com/OpenModelica/OMPython.git
|
---|
25 |
|
---|
26 | # ADD non-root users
|
---|
27 | RUN useradd -m -s /bin/bash openmodelicausers
|
---|
28 |
|
---|
29 | # add and set up the working directory
|
---|
30 | ADD . /compile_mod
|
---|
31 | WORKDIR /compile_mod
|
---|
32 |
|
---|
33 | # set user permissions to the directory
|
---|
34 | RUN chown -R openmodelicausers:openmodelicausers /compile_mod
|
---|
35 | RUN chmod 755 /compile_mod
|
---|
36 |
|
---|
37 | RUN pip3 install -r /compile_mod/requirements.txt
|
---|
38 |
|
---|
39 | USER openmodelicausers
|
---|
40 | ENV USER openmodelicausers
|
---|
41 |
|
---|
42 |
|
---|
43 | #CMD /bin/bash
|
---|
44 | #CMD python3 compile_mod.py
|
---|