EG version upgrade to 1.3
[ealt-edge.git] / example-apps / ROBO / backup_BE / docker / Dockerfile
1 # Copyright 2020 Huawei Technologies Co., Ltd.
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
15 # FROM swr.ap-southeast-1.myhuaweicloud.com/edgegallery/openjdk:8u201-jdk-alpine
16
17 # currently this pod is running as root user due to this need to communicate with host shell.config
18 # in future this can be further checked with adding some level restrictions to user
19 FROM openjdk:11-jre-slim
20
21 ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64/bin/java
22
23 ENV APP_FILE backup.jar
24 ENV APP_HOME /usr/app
25
26 # Create the home directory for the new app user.
27 RUN mkdir -p /usr/app
28 RUN mkdir -p /usr/app/bin
29
30 # Create an app user so our program doesn't run as root.
31 RUN apt-get update && apt-get install -y sshpass
32
33 WORKDIR $APP_HOME
34
35 RUN chmod 750 $APP_HOME &&\
36     chmod -R 550 $APP_HOME/bin &&\
37     mkdir -p -m 750 $APP_HOME/config &&\
38     mkdir -p -m 750 $APP_HOME/log &&\
39     mkdir -p -m 750 $APP_HOME/packages &&\
40     mkdir -p -m 700 $APP_HOME/ssl &&\
41     mkdir -p -m 700 $APP_HOME/.kube
42
43 COPY /target/*.jar $APP_HOME/bin
44
45 EXPOSE 8091
46
47 # Change to the app user.
48
49 # Execute script & application
50 ENTRYPOINT ["sh", "-c"]
51 CMD ["exec java -jar ./bin/backup.jar"]