forked from voltrondata/sqlflite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-slim.ci
45 lines (33 loc) · 1.24 KB
/
Dockerfile-slim.ci
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
FROM ubuntu:24.04
ARG TARGETPLATFORM
ARG TARGETARCH
ARG TARGETVARIANT
RUN printf "I'm building for TARGETPLATFORM=${TARGETPLATFORM}" \
&& printf ", TARGETARCH=${TARGETARCH}" \
&& printf ", TARGETVARIANT=${TARGETVARIANT} \n" \
&& printf "With uname -s : " && uname -s \
&& printf "and uname -m : " && uname -m
RUN apt-get update && \
apt-get dist-upgrade --yes && \
apt-get install -y \
curl \
zip && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Create an application user
RUN useradd app_user --create-home
ARG APP_DIR=/opt/flight_sql
RUN mkdir --parents ${APP_DIR} && \
chown app_user:app_user ${APP_DIR} && \
chown --recursive app_user:app_user /usr/local
# Switch to a less privileged user...
USER app_user
WORKDIR ${APP_DIR}
# Copy the scripts directory into the image (we copy directory-by-directory in order to maximize Docker caching)
COPY --chown=app_user:app_user scripts scripts
COPY --chown=app_user:app_user flight_sql_server /usr/local/bin/flight_sql_server
RUN chmod +x /usr/local/bin/flight_sql_server
COPY --chown=app_user:app_user flight_sql_client /usr/local/bin/flight_sql_client
RUN chmod +x /usr/local/bin/flight_sql_client
EXPOSE 31337
ENTRYPOINT scripts/start_flight_sql_slim.sh