Bug 1858: Adding APT proxy
[osm/devops.git] / docker / Keystone / Dockerfile
1 #######################################################################################
2 # Copyright ETSI Contributors and Others.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #    http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13 # implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #######################################################################################
17 FROM ubuntu:20.04
18
19 ARG APT_PROXY
20 RUN if [ ! -z $APT_PROXY ] ; then \
21     echo "Acquire::http::Proxy \"$APT_PROXY\";" > /etc/apt/apt.conf.d/proxy.conf ;\
22     echo "Acquire::https::Proxy \"$APT_PROXY\";" >> /etc/apt/apt.conf.d/proxy.conf ;\
23     fi
24
25 EXPOSE 5000
26
27 WORKDIR /keystone
28
29 COPY scripts/start.sh /keystone/start.sh
30
31 RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
32     DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
33     DEBIAN_FRONTEND=noninteractive apt-get autoremove -y && \
34     DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common && \
35     add-apt-repository -y cloud-archive:victoria && \
36     DEBIAN_FRONTEND=noninteractive apt-get update && \
37     DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y && \
38     DEBIAN_FRONTEND=noninteractive apt-get install -y \
39     apache2=2.4.* \
40     keystone=2:18.0.* \
41     libapache2-mod-wsgi-py3=4.6.* \
42     python3-pip=20.0.* \
43     build-essential=12.8* \
44     python3-dev=3.8.* \
45     libldap2-dev=2.4.* \
46     libsasl2-dev=2.1.* \
47     libssl-dev=1.1.* \
48     libffi-dev=3.3* \
49     libxml2-dev=2.9.* \
50     libxslt1-dev=1.1.* \
51     zlib1g-dev=1:1.2.* \
52     ldap-utils=2.4.* \
53     curl=7.68.* \
54     net-tools=1.60* \
55     mysql-client=8.0.* \
56     dnsutils=1:9.16.* && \
57     rm -rf /var/lib/apt/lists/* && \
58     chmod +x start.sh
59
60 RUN pip3 install -U pip==21.3.1 && \
61     pip3 install python-ldap==3.2.0 ldappool==3.0.0 python-openstackclient==5.7.0
62
63 # database
64 ENV DB_HOST                 keystone-db
65 ENV DB_PORT                 3306
66 ENV ROOT_DB_USER            root
67 ENV ROOT_DB_PASSWORD        admin
68 ENV KEYSTONE_DB_PASSWORD    admin
69 # keystone
70 ENV REGION_ID               RegionOne
71 ENV KEYSTONE_HOST           keystone
72 # admin user
73 ENV ADMIN_USERNAME          admin
74 ENV ADMIN_PASSWORD          admin
75 ENV ADMIN_PROJECT           admin
76 # nbi service user
77 ENV SERVICE_USERNAME        nbi
78 ENV SERVICE_PASSWORD        nbi
79 ENV SERVICE_PROJECT         service
80 # ldap
81 # ENV LDAP_AUTHENTICATION_DOMAIN_NAME     no default
82 # ENV LDAP_URL                            ldap://localhost
83 # ENV LDAP_BIND_USER                      no default
84 # ENV LDAP_BIND_PASSWORD                  no default
85 # ENV LDAP_CHASE_REFERRALS                no default
86 # ENV LDAP_PAGE_SIZE                      0
87 # ENV LDAP_USER_TREE_DN                   no default
88 # ENV LDAP_USER_OBJECTCLASS               inetOrgPerson
89 # ENV LDAP_USER_ID_ATTRIBUTE              cn
90 # ENV LDAP_USER_NAME_ATTRIBUTE            sn
91 # ENV LDAP_USER_PASS_ATTRIBUTE            userPassword
92 # ENV LDAP_USER_FILTER                    no default
93 # ENV LDAP_USER_ENABLED_ATTRIBUTE         enabled
94 # ENV LDAP_USER_ENABLED_MASK              0
95 # ENV LDAP_USER_ENABLED_DEFAULT           true
96 # ENV LDAP_USER_ENABLED_INVERT            false
97 # ENV LDAP_GROUP_OBJECTCLASS              groupOfNames
98 # ENV LDAP_GROUP_TREE_DN                  no default
99 # ENV LDAP_USE_STARTTLS                   false
100 # ENV LDAP_TLS_CACERT_BASE64              no default
101 # ENV LDAP_TLS_REQ_CERT                   demand
102
103 ENTRYPOINT ["./start.sh"]