-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (28 loc) · 929 Bytes
/
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
## this stage installs everything required to build the project
FROM crystallang/crystal:1.0.0-alpine as build
RUN apk add openssl-dev openssl-libs-static zlib-static upx
WORKDIR /tmp
COPY ./src/feron.cr /tmp
RUN \
crystal build --static feron.cr && \
upx /tmp/feron
## this stage created final docker image
FROM alpine:3.13 as release
COPY --from=build /tmp/feron /usr/local/bin/feron
USER nobody
ENTRYPOINT [ "/usr/local/bin/feron" ]
CMD [ "--help" ]
## this stage installs everything required to build the project
# FROM crystallang/crystal:1.0.0 as build
# RUN apt-get update && apt-get install zlib1g-dev upx
# WORKDIR /tmp
# COPY ./src/feron.cr /tmp
# RUN \
# crystal build feron.cr && \
# upx /tmp/feron
# ## this stage created final docker image
# FROM alpine:3.13 as release
# COPY --from=build /tmp/feron /usr/local/bin/feron
# USER nobody
# ENTRYPOINT [ "/usr/local/bin/feron" ]
# CMD [ "--help" ]