forked from memsql/deployment-docker
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile-node
54 lines (45 loc) · 1.72 KB
/
Dockerfile-node
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
# vim: ft=dockerfile
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
# install SingleStore client and server packages
ARG CLIENT_VERSION
ARG SERVER_VERSION
ARG LOCAL_SERVER_RPM
ARG JRE_PACKAGES
ADD assets /assets
RUN if [[ -z "${LOCAL_SERVER_RPM}" ]] ; then \
yum install -y memsql-server${SERVER_VERSION}; \
else \
rpm -i /assets/${LOCAL_SERVER_RPM}; \
fi \
&& for pkg in ${JRE_PACKAGES} ; do \
yum install -y ${pkg}; \
done \
&& yum install -y singlestore-client-${CLIENT_VERSION} \
&& yum clean all
VOLUME ["/var/lib/memsql"]
LABEL name="SingleStore DB Node"
LABEL vendor="SingleStore"
LABEL version=${SERVER_VERSION}
LABEL release=1
LABEL summary="The official Docker image for running a single-node SingleStore DB server."
LABEL description="The official Docker image for running a single-node SingleStore DB server."
LABEL io.k8s.display-name="SingleStore Node"
LABEL io.k8s.description="The official Docker image for running a single-node SingleStore DB server."
LABEL io.openshift.tags="database,db,sql,memsql,singlestore"
RUN chmod -R 444 /assets \
&& chmod 555 /assets \
&& chmod 555 /assets/startup-node /assets/init-node-container
# The init-container script is called by the SingleStore Operator in a separate
# init-container. This is used to setup things like volume permissions.
RUN ln -s /assets/init-node-container /init-container
# Do not lock the user to `memsql` so that the container will work with
# arbitrary securityContexts.
#
# Note: This will return exit code 1 if no match is found. That means
# something upstream has changed, please investigate before updating things
# here.
RUN sed -i '${/user = "memsql"/d;q1;}' /etc/memsql/memsqlctl.hcl
EXPOSE 3306/tcp
USER memsql
CMD ["/assets/startup-node"]