blob: 949221d527e04caec79ef85e5993cb0cd26825c4 [file] [log] [blame]
Scott Baker82b2b082018-04-16 16:02:14 -07001# 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 Baker82b2b082018-04-16 16:02:14 -070015# xosproject/kubernetes-synchronizer
Zack Williamsfc85ade2019-03-11 11:05:47 -070016FROM xosproject/alpine-grpc-base:0.9.0
Scott Baker82b2b082018-04-16 16:02:14 -070017
Zack Williamsfc85ade2019-03-11 11:05:47 -070018# Install curl (to download kubectl later)
19RUN apk add --no-cache curl
20
21# Install pip packages
22COPY requirements.txt /tmp/requirements.txt
23RUN 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 Baker82b2b082018-04-16 16:02:14 -070027COPY xos/synchronizer /opt/xos/synchronizers/kubernetes
28COPY VERSION /opt/xos/synchronizers/kubernetes/
29
Zack Williamsfc85ade2019-03-11 11:05:47 -070030# Install kubectl
31ENV KUBECTL_VERSION "1.12.6"
32ENV KUBECTL_SHA256SUM "ff94e3024dd245bf8761fac1b244776b169ade056daec2e1ccaf9b65f1d646ca"
Scott Baker1a2ee302018-08-27 16:16:19 -070033RUN 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 Baker82b2b082018-04-16 16:02:14 -070039WORKDIR "/opt/xos/synchronizers/kubernetes"
40
41# Label image
Scott Baker82b2b082018-04-16 16:02:14 -070042ARG org_label_schema_version=unknown
43ARG org_label_schema_vcs_url=unknown
44ARG org_label_schema_vcs_ref=unknown
45ARG org_label_schema_build_date=unknown
46ARG org_opencord_vcs_commit_date=unknown
Scott Baker82b2b082018-04-16 16:02:14 -070047
Zack Williamsfc85ade2019-03-11 11:05:47 -070048LABEL org.label-schema.schema-version=1.0 \
49 org.label-schema.name=kubernetes-synchronizer \
Scott Baker82b2b082018-04-16 16:02:14 -070050 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 Williamsfc85ade2019-03-11 11:05:47 -070054 org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date
Scott Baker82b2b082018-04-16 16:02:14 -070055
Zack Williamsc51e4422018-05-30 13:54:05 -070056CMD ["/usr/bin/python", "/opt/xos/synchronizers/kubernetes/kubernetes-synchronizer.py"]