-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Dockerfile
28 lines (24 loc) · 1.12 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
FROM alpine:3.20@sha256:0a4eaa0eecf5f8c050e5bba433f58c052be7587ee8af3e8b3910ef9ab5fbe9f5 AS deps
RUN apk add --no-cache gcc make libc-dev libev-dev
WORKDIR /src/mysql-honeypotd
COPY . /src/mysql-honeypotd
FROM deps AS build-dynamic
ENV \
CFLAGS="-Os -g0 -Wall -Wextra -Wno-unknown-pragmas -fvisibility=hidden -fno-strict-aliasing -Wno-unused-parameter" \
CPPFLAGS="-D_DEFAULT_SOURCE"
RUN make && strip mysql-honeypotd
FROM deps AS build-static
ENV \
CFLAGS="-Os -g0 -Wall -Wextra -Wno-unknown-pragmas -fvisibility=hidden -fno-strict-aliasing -Wno-unused-parameter" \
CPPFLAGS="-D_DEFAULT_SOURCE -DMINIMALISTIC_BUILD" \
LDFLAGS="-static"
RUN make && strip mysql-honeypotd
FROM alpine:3.20@sha256:0a4eaa0eecf5f8c050e5bba433f58c052be7587ee8af3e8b3910ef9ab5fbe9f5 AS release-dynamic
RUN apk add --no-cache libev
COPY --from=build-dynamic /src/mysql-honeypotd/mysql-honeypotd /usr/bin/mysql-honeypotd
EXPOSE 3306
CMD ["/usr/bin/mysql-honeypotd", "--foreground", "--no-syslog"]
FROM scratch AS release-static
COPY --from=build-static /src/mysql-honeypotd/mysql-honeypotd /mysql-honeypotd
EXPOSE 3306
ENTRYPOINT ["/mysql-honeypotd"]