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 |
Zack Williams | 9a76635 | 2019-04-09 18:08:05 -0700 | [diff] [blame] | 16 | FROM xosproject/alpine-grpc-base:0.9.0 |
| 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 |
| 31 | RUN pip install -e /opt/xos/lib/xos-util \ |
| 32 | && pip install -e /opt/xos/lib/xos-config \ |
| 33 | && pip install -e /opt/xos/lib/xos-genx \ |
| 34 | && pip install -e /opt/xos/lib/xos-kafka \ |
| 35 | && pip freeze > /var/xos/pip_freeze_xos-core_libs_`date -u +%Y%m%dT%H%M%S` \ |
| 36 | && mkdir -p /opt/cord_profile /opt/xos-services /opt/xos_libraries \ |
Zack Williams | ffc9b21 | 2018-03-22 17:25:33 -0700 | [diff] [blame] | 37 | && xosgenx --output /opt/xos/core/models --target django.xtarget --dest-extension py \ |
| 38 | --write-to-file model /opt/xos/core/models/core.xproto \ |
| 39 | && xosgenx --output /opt/xos/core/models --target django-security.xtarget --dest-file security.py \ |
| 40 | --write-to-file single /opt/xos/core/models/core.xproto \ |
| 41 | && xosgenx --output /opt/xos/core/models --target init.xtarget --dest-file __init__.py \ |
| 42 | --write-to-file single /opt/xos/core/models/core.xproto |
Scott Baker | 21cbf27 | 2018-03-30 08:19:07 -0700 | [diff] [blame] | 43 | |
| 44 | # Set environment variables |
| 45 | ENV HOME /root |
| 46 | |
| 47 | # Define working directory |
| 48 | WORKDIR /opt/xos |
| 49 | |
| 50 | # Label image |
Scott Baker | 21cbf27 | 2018-03-30 08:19:07 -0700 | [diff] [blame] | 51 | ARG org_label_schema_version=unknown |
| 52 | ARG org_label_schema_vcs_url=unknown |
| 53 | ARG org_label_schema_vcs_ref=unknown |
| 54 | ARG org_label_schema_build_date=unknown |
| 55 | ARG org_opencord_vcs_commit_date=unknown |
| 56 | |
Zack Williams | 9a76635 | 2019-04-09 18:08:05 -0700 | [diff] [blame] | 57 | LABEL org.label-schema.schema-version=1.0 \ |
| 58 | org.label-schema.name=xos-core \ |
Scott Baker | 21cbf27 | 2018-03-30 08:19:07 -0700 | [diff] [blame] | 59 | org.label-schema.version=$org_label_schema_version \ |
| 60 | org.label-schema.vcs-url=$org_label_schema_vcs_url \ |
| 61 | org.label-schema.vcs-ref=$org_label_schema_vcs_ref \ |
| 62 | org.label-schema.build-date=$org_label_schema_build_date \ |
| 63 | org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date |