-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
47 lines (35 loc) · 1.34 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
FROM ubuntu:20.04
## refs: https://luarocks.org/
## refs: https://luarocks.cn/
USER root
# Install lua depends
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y sudo nano make cmake gcc g++ git luarocks libssl-dev \
&& apt-get autoclean \
&& apt-get clean \
&& apt-get autoremove \
&& rm -rf /var/lib/apt/lists/*
RUN git config --global user.name "wangyc@risetek.com" && git config --global user.email "wangyc@risetek.com" \
&& echo export LS_COLORS='$LS_COLORS':\''di=01;35':\' >> /root/.bashrc
RUN luarocks install luasocket --server https://luarocks.cn
RUN luarocks install luamqtt --server https://luarocks.cn
RUN luarocks install luabitop --server https://luarocks.cn
RUN luarocks install lua-protobuf --server https://luarocks.cn
RUN luarocks install serpent --server https://luarocks.cn
## RUN luarocks install effil --server https://luarocks.cn ## failed
# for lua nats support
RUN luarocks install lua-cjson --server https://luarocks.cn
RUN luarocks install uuid --server https://luarocks.cn
## custom lua programs
RUN mkdir -p /luapath
WORKDIR /luapath
COPY ./*.lua . ./
COPY ./nats/* ./
COPY ./iot/iot.lua ./
COPY ./bootstrap/preload.lua ./
COPY docker/docker-entrypoint.sh /entrypoint.sh
RUN lua -e "print ('hello LUA world')"
ENTRYPOINT ["/entrypoint.sh"]
VOLUME /luapath
WORKDIR /luapath
CMD ["/bin/bash"]