-
Notifications
You must be signed in to change notification settings - Fork 90
/
Dockerfile
68 lines (57 loc) · 2.78 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# --------------------------------------------------------------------
# Copyright (c) 2022, WSO2 LLC. (http:https://wso2.com) All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# -----------------------------------------------------------------------
FROM alpine:3.17.2
LABEL maintainer="WSO2 Docker Maintainers <wso2.com>"
RUN apk update && apk upgrade --no-cache
RUN apk add --no-cache tzdata
ENV LANG=C.UTF-8
ARG APK_USER=wso2
ARG APK_USER_ID=802
ARG APK_USER_GROUP=wso2
ARG APK_USER_GROUP_ID=802
ARG APK_USER_HOME=/home/${APK_USER}
ARG GRPC_HEALTH_PROBE_PATH=/bin/grpc_health_probe
ARG TARGETARCH
ENV MGT_SERVER_PRIVATE_KEY_PATH=/home/wso2/security/keystore/mg.key
ENV MGT_SERVER_PUBLIC_CERT_PATH=/home/wso2/security/keystore/mg.pem
ARG CHECKSUM_AMD64="c72704c9cd49fb18f8df28de26e29c2563b6515e38efee65a6c3a29ec7368a91"
ARG CHECKSUM_ARM64="a7b42093b702ea83f4dcbd1dd74e4085c118fe93b9cfd3f205e48506a9ac94a0"
ARG MOTD="\n\
Welcome to WSO2 Docker Resources \n\
--------------------------------- \n\
This Docker container comprises of a WSO2 product, running with its latest GA release \n\
which is under the Apache License, Version 2.0. \n\
Read more about Apache License, Version 2.0 here @ http:https://www.apache.org/licenses/LICENSE-2.0.\n"
RUN \
addgroup -S -g ${APK_USER_GROUP_ID} ${APK_USER_GROUP} \
&& adduser -S -u ${APK_USER_ID} -h ${APK_USER_HOME} -G ${APK_USER_GROUP} ${APK_USER} \
&& mkdir ${APK_USER_HOME}/logs && mkdir -p ${APK_USER_HOME}/artifacts/apis \
&& chown -R ${APK_USER}:${APK_USER_GROUP} ${APK_USER_HOME} \
&& echo '[ ! -z "${TERM}" -a -r /etc/motd ] && cat /etc/motd' >> /etc/bash.bashrc; echo "${MOTD}" > /etc/motd
RUN \
wget -q https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/v0.4.16/grpc_health_probe-linux-${TARGETARCH} \
&& mv grpc_health_probe-linux-${TARGETARCH} ${GRPC_HEALTH_PROBE_PATH}\
&& if [ "${TARGETARCH}" = "amd64" ]; then echo "${CHECKSUM_AMD64} ${GRPC_HEALTH_PROBE_PATH}" | sha256sum -c -; fi
RUN \
chmod +x ${GRPC_HEALTH_PROBE_PATH} \
&& chown ${APK_USER}:${APK_USER_GROUP} ${GRPC_HEALTH_PROBE_PATH}
WORKDIR ${APK_USER_HOME}
USER ${APK_USER}
COPY resources/conf/config.toml conf/
COPY resources/conf/log_config.toml conf/
COPY ./${TARGETARCH}/main mgt_server
COPY resources/check_health.sh .
CMD ./mgt_server