Scott Baker | acb2bf6 | 2019-03-15 10:20:35 -0700 | [diff] [blame] | 1 | # Copyright 2018-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 | 5969fc8 | 2019-03-27 12:14:09 -0700 | [diff] [blame] | 15 | # docker build -t smbaker/testservice-synchronizer:test -f Dockerfile.synchronizer .. |
Scott Baker | acb2bf6 | 2019-03-15 10:20:35 -0700 | [diff] [blame] | 16 | |
| 17 | # xosproject/testservice |
| 18 | |
Scott Baker | 5969fc8 | 2019-03-27 12:14:09 -0700 | [diff] [blame] | 19 | FROM xosproject/alpine-grpc-base:0.9.0 |
Scott Baker | acb2bf6 | 2019-03-15 10:20:35 -0700 | [diff] [blame] | 20 | |
Scott Baker | 5969fc8 | 2019-03-27 12:14:09 -0700 | [diff] [blame] | 21 | # Add libraries |
| 22 | COPY lib /opt/xos/lib |
| 23 | COPY VERSION /opt/xos |
| 24 | |
| 25 | # Install non-xos pip packages |
| 26 | COPY testservice/requirements.txt /tmp/requirements.txt |
| 27 | RUN pip install -r /tmp/requirements.txt \ |
| 28 | && pip freeze > /var/xos/pip_freeze_requirements_`date -u +%Y%m%dT%H%M%S` |
| 29 | |
| 30 | # Install xos packages using pip so their dependencies are installed |
| 31 | RUN pip install -e /opt/xos/lib/xos-config \ |
| 32 | && pip install -e /opt/xos/lib/xos-genx \ |
| 33 | && pip install -e /opt/xos/lib/xos-kafka \ |
| 34 | && pip install -e /opt/xos/lib/xos-api \ |
| 35 | && pip install -e /opt/xos/lib/xos-synchronizer \ |
| 36 | && pip freeze > /var/xos/pip_freeze_libraries_`date -u +%Y%m%dT%H%M%S` |
| 37 | |
| 38 | # Install the synchronizer |
| 39 | COPY testservice/xos/synchronizer /opt/xos/synchronizers/testservice |
Scott Baker | acb2bf6 | 2019-03-15 10:20:35 -0700 | [diff] [blame] | 40 | |
| 41 | ENTRYPOINT [] |
| 42 | |
| 43 | WORKDIR "/opt/xos/synchronizers/testservice" |
| 44 | |
| 45 | # Label image |
| 46 | ARG org_label_schema_schema_version=1.0 |
| 47 | ARG org_label_schema_name=testservice |
| 48 | ARG org_label_schema_version=unknown |
| 49 | ARG org_label_schema_vcs_url=unknown |
| 50 | ARG org_label_schema_vcs_ref=unknown |
| 51 | ARG org_label_schema_build_date=unknown |
| 52 | ARG org_opencord_vcs_commit_date=unknown |
| 53 | ARG org_opencord_component_chameleon_version=unknown |
| 54 | ARG org_opencord_component_chameleon_vcs_url=unknown |
| 55 | ARG org_opencord_component_chameleon_vcs_ref=unknown |
| 56 | ARG org_opencord_component_xos_version=unknown |
| 57 | ARG org_opencord_component_xos_vcs_url=unknown |
| 58 | ARG org_opencord_component_xos_vcs_ref=unknown |
| 59 | |
| 60 | LABEL org.label-schema.schema-version=$org_label_schema_schema_version \ |
| 61 | org.label-schema.name=$org_label_schema_name \ |
| 62 | org.label-schema.version=$org_label_schema_version \ |
| 63 | org.label-schema.vcs-url=$org_label_schema_vcs_url \ |
| 64 | org.label-schema.vcs-ref=$org_label_schema_vcs_ref \ |
| 65 | org.label-schema.build-date=$org_label_schema_build_date \ |
| 66 | org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date \ |
| 67 | org.opencord.component.chameleon.version=$org_opencord_component_chameleon_version \ |
| 68 | org.opencord.component.chameleon.vcs-url=$org_opencord_component_chameleon_vcs_url \ |
| 69 | org.opencord.component.chameleon.vcs-ref=$org_opencord_component_chameleon_vcs_ref \ |
| 70 | org.opencord.component.xos.version=$org_opencord_component_xos_version \ |
| 71 | org.opencord.component.xos.vcs-url=$org_opencord_component_xos_vcs_url \ |
| 72 | org.opencord.component.xos.vcs-ref=$org_opencord_component_xos_vcs_ref |
| 73 | |
Scott Baker | 5969fc8 | 2019-03-27 12:14:09 -0700 | [diff] [blame] | 74 | CMD ["/usr/bin/python", "/opt/xos/synchronizers/testservice/testservice-synchronizer.py"] |
| 75 | |