Scott Baker | 21cbf27 | 2018-03-30 08:19:07 -0700 | [diff] [blame] | 1 | # Copyright 2017-present Open Networking Foundation |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
Scott Baker | 21cbf27 | 2018-03-30 08:19:07 -0700 | [diff] [blame] | 15 | # xosproject/xos-core |
Scott Baker | 4447685 | 2019-05-02 11:44:26 -0700 | [diff] [blame] | 16 | FROM xosproject/alpine-grpc-base:0.9.1 |
Zack Williams | 9a76635 | 2019-04-09 18:08:05 -0700 | [diff] [blame] | 17 | |
| 18 | # Install libraries and python requirements |
| 19 | COPY requirements.txt /tmp/requirements.txt |
Scott Baker | 6bd238f | 2019-04-16 16:28:52 -0700 | [diff] [blame] | 20 | RUN apk add --no-cache bash postgresql-dev postgresql-client \ |
Zack Williams | 9a76635 | 2019-04-09 18:08:05 -0700 | [diff] [blame] | 21 | && pip install -r /tmp/requirements.txt \ |
| 22 | && pip freeze > /var/xos/pip_freeze_xos-core_`date -u +%Y%m%dT%H%M%S` \ |
| 23 | && mkdir -p /opt/xos |
Scott Baker | 21cbf27 | 2018-03-30 08:19:07 -0700 | [diff] [blame] | 24 | |
| 25 | # Install XOS |
Zack Williams | 9a76635 | 2019-04-09 18:08:05 -0700 | [diff] [blame] | 26 | COPY VERSION /opt/xos |
| 27 | COPY xos /opt/xos |
| 28 | COPY lib /opt/xos/lib |
Scott Baker | 21cbf27 | 2018-03-30 08:19:07 -0700 | [diff] [blame] | 29 | |
Zack Williams | 9a76635 | 2019-04-09 18:08:05 -0700 | [diff] [blame] | 30 | # Install XOS libraries |
Scott Baker | 89704b1 | 2019-05-07 16:42:11 -0700 | [diff] [blame] | 31 | RUN pip install -e /opt/xos/lib/xos-config \ |
Zack Williams | 9a76635 | 2019-04-09 18:08:05 -0700 | [diff] [blame] | 32 | && pip install -e /opt/xos/lib/xos-genx \ |
| 33 | && pip install -e /opt/xos/lib/xos-kafka \ |
| 34 | && pip freeze > /var/xos/pip_freeze_xos-core_libs_`date -u +%Y%m%dT%H%M%S` \ |
| 35 | && mkdir -p /opt/cord_profile /opt/xos-services /opt/xos_libraries \ |
Zack Williams | ffc9b21 | 2018-03-22 17:25:33 -0700 | [diff] [blame] | 36 | && xosgenx --output /opt/xos/core/models --target django.xtarget --dest-extension py \ |
| 37 | --write-to-file model /opt/xos/core/models/core.xproto \ |
| 38 | && xosgenx --output /opt/xos/core/models --target django-security.xtarget --dest-file security.py \ |
| 39 | --write-to-file single /opt/xos/core/models/core.xproto \ |
| 40 | && xosgenx --output /opt/xos/core/models --target init.xtarget --dest-file __init__.py \ |
| 41 | --write-to-file single /opt/xos/core/models/core.xproto |
Scott Baker | 21cbf27 | 2018-03-30 08:19:07 -0700 | [diff] [blame] | 42 | |
| 43 | # Set environment variables |
| 44 | ENV HOME /root |
| 45 | |
| 46 | # Define working directory |
| 47 | WORKDIR /opt/xos |
| 48 | |
| 49 | # Label image |
Scott Baker | 21cbf27 | 2018-03-30 08:19:07 -0700 | [diff] [blame] | 50 | ARG org_label_schema_version=unknown |
| 51 | ARG org_label_schema_vcs_url=unknown |
| 52 | ARG org_label_schema_vcs_ref=unknown |
| 53 | ARG org_label_schema_build_date=unknown |
| 54 | ARG org_opencord_vcs_commit_date=unknown |
| 55 | |
Scott Baker | 89704b1 | 2019-05-07 16:42:11 -0700 | [diff] [blame] | 56 | # Record git build information |
| 57 | RUN echo $org_label_schema_vcs_ref > /opt/xos/COMMIT |
| 58 | |
Zack Williams | 9a76635 | 2019-04-09 18:08:05 -0700 | [diff] [blame] | 59 | LABEL org.label-schema.schema-version=1.0 \ |
| 60 | org.label-schema.name=xos-core \ |
Scott Baker | 21cbf27 | 2018-03-30 08:19:07 -0700 | [diff] [blame] | 61 | org.label-schema.version=$org_label_schema_version \ |
| 62 | org.label-schema.vcs-url=$org_label_schema_vcs_url \ |
| 63 | org.label-schema.vcs-ref=$org_label_schema_vcs_ref \ |
| 64 | org.label-schema.build-date=$org_label_schema_build_date \ |
| 65 | org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date |