Zack Williams | 6bb2cfe | 2019-03-27 15:01:45 -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. |
Matteo Scandolo | 1fedfae | 2017-10-09 13:57:00 -0700 | [diff] [blame] | 14 | |
Matteo Scandolo | 9ce1825 | 2017-06-22 10:48:25 -0700 | [diff] [blame] | 15 | # xosproject/xos-tosca |
Scott Baker | 08a1c08 | 2019-03-07 16:16:04 -0800 | [diff] [blame] | 16 | |
Zack Williams | 6bb2cfe | 2019-03-27 15:01:45 -0700 | [diff] [blame] | 17 | FROM xosproject/alpine-grpc-base:0.9.0 |
Matteo Scandolo | 5c0af1b | 2017-07-05 14:51:21 -0700 | [diff] [blame] | 18 | |
| 19 | # Set environment variables |
Matteo Scandolo | 5c0af1b | 2017-07-05 14:51:21 -0700 | [diff] [blame] | 20 | ENV CODE_DEST /opt/xos-tosca |
| 21 | WORKDIR ${CODE_DEST} |
| 22 | |
| 23 | # Add XOS-TOSCA code |
Zack Williams | 6bb2cfe | 2019-03-27 15:01:45 -0700 | [diff] [blame] | 24 | COPY . ${CODE_DEST}/ |
Matteo Scandolo | 5c0af1b | 2017-07-05 14:51:21 -0700 | [diff] [blame] | 25 | |
Zack Williams | 6bb2cfe | 2019-03-27 15:01:45 -0700 | [diff] [blame] | 26 | # Install python packages with pip |
| 27 | COPY requirements.txt /tmp/requirements.txt |
| 28 | RUN pip install -r /tmp/requirements.txt \ |
| 29 | && pip freeze > /var/xos/pip_freeze_xos-tosca_`date -u +%Y%m%dT%H%M%S` |
Matteo Scandolo | 5c0af1b | 2017-07-05 14:51:21 -0700 | [diff] [blame] | 30 | |
Matteo Scandolo | 5c0af1b | 2017-07-05 14:51:21 -0700 | [diff] [blame] | 31 | # Label image |
Matteo Scandolo | 5c0af1b | 2017-07-05 14:51:21 -0700 | [diff] [blame] | 32 | ARG org_label_schema_version=unknown |
| 33 | ARG org_label_schema_vcs_url=unknown |
| 34 | ARG org_label_schema_vcs_ref=unknown |
| 35 | ARG org_label_schema_build_date=unknown |
| 36 | ARG org_opencord_vcs_commit_date=unknown |
| 37 | |
Zack Williams | 6bb2cfe | 2019-03-27 15:01:45 -0700 | [diff] [blame] | 38 | |
| 39 | LABEL org.label-schema.schema-version=1.0 \ |
| 40 | org.label-schema.name=xos-tosca \ |
Matteo Scandolo | 5c0af1b | 2017-07-05 14:51:21 -0700 | [diff] [blame] | 41 | org.label-schema.version=$org_label_schema_version \ |
| 42 | org.label-schema.vcs-url=$org_label_schema_vcs_url \ |
| 43 | org.label-schema.vcs-ref=$org_label_schema_vcs_ref \ |
| 44 | org.label-schema.build-date=$org_label_schema_build_date \ |
Zack Williams | 6bb2cfe | 2019-03-27 15:01:45 -0700 | [diff] [blame] | 45 | org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date |
| 46 | |
| 47 | EXPOSE 9102 |
Matteo Scandolo | 5c0af1b | 2017-07-05 14:51:21 -0700 | [diff] [blame] | 48 | |
Zack Williams | dcf43d0 | 2017-07-17 17:16:35 -0700 | [diff] [blame] | 49 | ENTRYPOINT [ "/usr/bin/python", "src/main.py" ] |
| 50 | |