forked from 3scale/APIcast
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.devel
68 lines (51 loc) · 2.45 KB
/
Dockerfile.devel
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM registry.access.redhat.com/ubi8:8.5
ARG OPENRESTY_RPM_VERSION="1.19.3"
ARG LUAROCKS_VERSION="2.3.0"
WORKDIR /tmp
ENV APP_ROOT=/opt/app-root \
HOME=/opt/app-root/src \
PATH=/opt/app-root/src/bin:/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
PLATFORM="el8"
RUN sed -i s/enabled=./enabled=0/g /etc/yum/pluginconf.d/subscription-manager.conf
RUN yum upgrade -y
RUN dnf install -y 'dnf-command(config-manager)'
RUN yum install -y \
gcc make git which curl iputils bind-utils expat-devel kernel-headers openssl-devel m4 \
libyaml libyaml-devel perl-local-lib perl-App-cpanminus
# perl-Test-Nginx
RUN cpanm https://cpan.metacpan.org/authors/id/A/AG/AGENT/Test-Nginx-0.29.tar.gz
RUN yum config-manager --add-repo http://packages.dev.3sca.net/dev_packages_3sca_net.repo
RUN yum install -y \
openresty-${OPENRESTY_RPM_VERSION} \
openresty-resty-${OPENRESTY_RPM_VERSION} \
openresty-opentracing-${OPENRESTY_RPM_VERSION} \
jaegertracing-cpp-client
RUN ln -sf /dev/stdout /usr/local/openresty/nginx/logs/access.log \
&& ln -sf /dev/stderr /usr/local/openresty/nginx/logs/error.log \
&& mkdir -p /usr/local/openresty/nginx/client_body_temp/ \
&& chmod 777 /usr/local/openresty/nginx/client_body_temp/
COPY site_config.lua /usr/share/lua/5.1/luarocks/site_config.lua
COPY config-*.lua /usr/local/openresty/config-5.1.lua
ENV PATH="./lua_modules/bin:/usr/local/openresty/luajit/bin/:${PATH}" \
LUA_PATH="./lua_modules/share/lua/5.1/?.lua;./lua_modules/share/lua/5.1/?/init.lua;/usr/lib64/lua/5.1/?.lua;/usr/share/lua/5.1/?.lua" \
LUA_CPATH="./lua_modules/lib/lua/5.1/?.so;;" \
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/app-root/lib"
RUN yum install -y luarocks-${LUAROCKS_VERSION} && \
luarocks install --server=http://luarocks.org/dev lua-rover && \
rover -v && \
yum -y remove luarocks && \
ln -s /usr/bin/rover /usr/local/openresty/luajit/bin/ && \
chmod g+w "${HOME}/.cache" && \
rm -rf /var/cache/yum && yum clean all -y && \
rm -rf "${HOME}/.cache/luarocks" ./*
# Directory with the sources is set as the working directory so all STI scripts
# can execute relative to this path.
WORKDIR ${HOME}
# Reset permissions of modified directories and add default user
RUN useradd -u 1001 -r -g 0 -d ${HOME} -s /sbin/nologin \
-c "Default Application User" default && \
chown -R 1001:0 ${APP_ROOT}
USER 1001
WORKDIR ${HOME}
EXPOSE 8080
CMD ["/bin/bash"]