Scott Baker | 14c8f18 | 2019-05-22 18:05:29 -0700 | [diff] [blame^] | 1 | # Portions copyright 2019-present Open Networking Foundation |
| 2 | # Original copyright 2019-present Ciena Corporation |
| 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 implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | # docker build -t xosproject/mock-xos:candidate . |
| 17 | |
| 18 | FROM xosproject/grpc-mock:1.0.0 as build |
| 19 | MAINTAINER Open Networking Foundation |
| 20 | |
| 21 | RUN apk add --update git python2 py-pip make |
| 22 | |
| 23 | WORKDIR /xos |
| 24 | RUN mkdir /xos/v1 |
| 25 | RUN git clone https://github.com/opencord/xos /opt/tmp_xos && mv /opt/tmp_xos/xos /opt/xos && mv /opt/tmp_xos/lib /opt/xos/lib && cp /opt/tmp_xos/VERSION /opt/xos |
| 26 | RUN cd /opt/xos/lib/xos-genx && python setup.py install |
| 27 | RUN cd /opt/xos/coreapi/protos && make rebuild-protos |
| 28 | |
| 29 | RUN cp -r /opt/xos/coreapi/protos/*.proto /xos/v1 |
| 30 | |
| 31 | COPY clean.sh /xos/clean.sh |
| 32 | RUN /xos/clean.sh |
| 33 | |
| 34 | FROM xosproject/grpc-mock:1.0.0 |
| 35 | ENV GRPC_MOCK_COMPARE=sparse |
| 36 | |
| 37 | WORKDIR /xos |
| 38 | COPY --from=build /xos /xos |
| 39 | COPY mock.sh clean.sh mock-v1.js data.json /xos/ |
| 40 | RUN chmod 755 /xos/mock.sh /xos/clean.sh |
| 41 | |
| 42 | ENTRYPOINT ["/xos/mock.sh"] |