Scott Baker | 82b2b08 | 2018-04-16 16:02:14 -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 | 82b2b08 | 2018-04-16 16:02:14 -0700 | [diff] [blame] | 15 | # xosproject/kubernetes-synchronizer |
Zack Williams | fc85ade | 2019-03-11 11:05:47 -0700 | [diff] [blame] | 16 | FROM xosproject/alpine-grpc-base:0.9.0 |
Scott Baker | 82b2b08 | 2018-04-16 16:02:14 -0700 | [diff] [blame] | 17 | |
Zack Williams | fc85ade | 2019-03-11 11:05:47 -0700 | [diff] [blame] | 18 | # Install curl (to download kubectl later) |
| 19 | RUN apk add --no-cache curl |
| 20 | |
| 21 | # Install pip packages |
| 22 | COPY requirements.txt /tmp/requirements.txt |
| 23 | RUN pip install -r /tmp/requirements.txt \ |
| 24 | && pip freeze > /var/xos/pip_freeze_kubernetes_service_`date -u +%Y%m%dT%H%M%S` |
| 25 | |
| 26 | # Copy code |
Scott Baker | 82b2b08 | 2018-04-16 16:02:14 -0700 | [diff] [blame] | 27 | COPY xos/synchronizer /opt/xos/synchronizers/kubernetes |
| 28 | COPY VERSION /opt/xos/synchronizers/kubernetes/ |
| 29 | |
Zack Williams | fc85ade | 2019-03-11 11:05:47 -0700 | [diff] [blame] | 30 | # Install kubectl |
| 31 | ENV KUBECTL_VERSION "1.12.6" |
| 32 | ENV KUBECTL_SHA256SUM "ff94e3024dd245bf8761fac1b244776b169ade056daec2e1ccaf9b65f1d646ca" |
Scott Baker | 1a2ee30 | 2018-08-27 16:16:19 -0700 | [diff] [blame] | 33 | RUN curl -L -o /tmp/kubectl "https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl" \ |
| 34 | && echo "$KUBECTL_SHA256SUM /tmp/kubectl" | sha256sum -c - \ |
| 35 | && mv /tmp/kubectl /usr/local/bin/kubectl \ |
| 36 | && chmod a+x /usr/local/bin/kubectl \ |
| 37 | && rm -f /tmp/kubectl |
| 38 | |
Scott Baker | 82b2b08 | 2018-04-16 16:02:14 -0700 | [diff] [blame] | 39 | WORKDIR "/opt/xos/synchronizers/kubernetes" |
| 40 | |
| 41 | # Label image |
Scott Baker | 82b2b08 | 2018-04-16 16:02:14 -0700 | [diff] [blame] | 42 | ARG org_label_schema_version=unknown |
| 43 | ARG org_label_schema_vcs_url=unknown |
| 44 | ARG org_label_schema_vcs_ref=unknown |
| 45 | ARG org_label_schema_build_date=unknown |
| 46 | ARG org_opencord_vcs_commit_date=unknown |
Scott Baker | 82b2b08 | 2018-04-16 16:02:14 -0700 | [diff] [blame] | 47 | |
Zack Williams | fc85ade | 2019-03-11 11:05:47 -0700 | [diff] [blame] | 48 | LABEL org.label-schema.schema-version=1.0 \ |
| 49 | org.label-schema.name=kubernetes-synchronizer \ |
Scott Baker | 82b2b08 | 2018-04-16 16:02:14 -0700 | [diff] [blame] | 50 | org.label-schema.version=$org_label_schema_version \ |
| 51 | org.label-schema.vcs-url=$org_label_schema_vcs_url \ |
| 52 | org.label-schema.vcs-ref=$org_label_schema_vcs_ref \ |
| 53 | org.label-schema.build-date=$org_label_schema_build_date \ |
Zack Williams | fc85ade | 2019-03-11 11:05:47 -0700 | [diff] [blame] | 54 | org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date |
Scott Baker | 82b2b08 | 2018-04-16 16:02:14 -0700 | [diff] [blame] | 55 | |
Zack Williams | c51e442 | 2018-05-30 13:54:05 -0700 | [diff] [blame] | 56 | CMD ["/usr/bin/python", "/opt/xos/synchronizers/kubernetes/kubernetes-synchronizer.py"] |