blob: 900c82541138723c121782aa565e4d7baaedf208 [file] [log] [blame]
Scott Baker14c8f182019-05-22 18:05:29 -07001# 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
18FROM xosproject/grpc-mock:1.0.0 as build
19MAINTAINER Open Networking Foundation
20
21RUN apk add --update git python2 py-pip make
22
23WORKDIR /xos
24RUN mkdir /xos/v1
25RUN 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
26RUN cd /opt/xos/lib/xos-genx && python setup.py install
27RUN cd /opt/xos/coreapi/protos && make rebuild-protos
28
29RUN cp -r /opt/xos/coreapi/protos/*.proto /xos/v1
30
31COPY clean.sh /xos/clean.sh
32RUN /xos/clean.sh
33
34FROM xosproject/grpc-mock:1.0.0
35ENV GRPC_MOCK_COMPARE=sparse
36
37WORKDIR /xos
38COPY --from=build /xos /xos
39COPY mock.sh clean.sh mock-v1.js data.json /xos/
40RUN chmod 755 /xos/mock.sh /xos/clean.sh
41
42ENTRYPOINT ["/xos/mock.sh"]