-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-alpine
58 lines (53 loc) · 1.97 KB
/
Dockerfile-alpine
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
# ##################################### #
# #
# How-To build this container image #
# #
# ##################################### #
#
#
# Local build
# -----------
# docker build \
# -f Dockerfile \
# --build-arg VERSION=`cat src/VERSION` \
# --build-arg GIT_BRANCH=`git branch --show-current` \
# -t safebytelabs-jgonf/gha-docker-demo:`cat src/VERSION` .
#
#
# Platform specific images (when you build for your own platform)
# ---------------------------------------------------------------
# docker build \
# --build-arg BUILD_DATE=`date -u +"%Y-%m-%d"` \
# --build-arg VERSION=`cat src/VERSION` \
# --build-arg GIT_BRANCH=`git branch --show-current` \
# -t ghcr.io/safebytelabs-jgonf/gha-docker-demo:`cat src/VERSION` .
#
#
# Cross-compile platform independent images (when you use a build facility
# in your platform to cross-compile for another platform)
# ------------------------------------------------------------------------
# docker buildx ls
# docker buildx create --name testbuilder
# docker buildx use testbuilder
# docker buildx inspect --bootstrap
# docker buildx build \
# --platform linux/amd64 linux/amd64/v2 linux/amd64/v3 \
# linux/arm64,linux/arm/v7, linux/arm/v6 \
# --build-arg BUILD_DATE=`date -u +"%Y-%m-%d"` \
# --build-arg VERSION=`cat src/VERSION` \
# --build-arg GIT_BRANCH=`git branch --show-current` \
# -t ghcr.io/safebytelabs-jgonf/gha-docker-demo:`cat src/VERSION` --push .
#
# #############################################################################
FROM alpine3.19
LABEL maintainer="Jonathan Gonzalez <[email protected]>"
ARG GIT_BRANCH
# - Let service stop gracefully
STOPSIGNAL SIGQUIT
# - Install packages
RUN apk add --no-cache PACKAGE
# - Copy project files into working directory
COPY ./src/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# - Run the program with a delay of 1 second (configurable at will)
CMD [ "/entrypoint.sh", "1" ]