-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.aarch64
117 lines (107 loc) · 2.9 KB
/
Dockerfile.aarch64
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# build semaphore
FROM golang:1.22-alpine3.18 as builder
# set versions and platforms
ARG SEMAPHORE_VERSION
RUN set -e && \
echo "**** install build packages ****" && \
apk add --no-cache \
curl \
g++ \
gcc \
git \
jq \
libc-dev \
nodejs \
npm \
tar \
unzip \
zip && \
echo "**** install task ****" && \
curl -sL https://taskfile.dev/install.sh | sh && \
echo "**** download semaphore ****" && \
if [ -z ${SEMAPHORE_VERSION+x} ]; then \
SEMAPHORE_VERSION=$(curl -sL https://api.github.com/repos/semaphoreui/semaphore/releases/latest | \
jq -r '.tag_name'); \
fi && \
git clone https://github.com/semaphoreui/semaphore.git /go/src/github.com/semaphoreui/semaphore && \
cd /go/src/github.com/semaphoreui/semaphore && \
git checkout ${SEMAPHORE_VERSION} && \
sed -i 's/\$(uname -m)/arm64/g' Taskfile.yml && \
git config --global --add safe.directory /go/src/github.com/semaphoreui/semaphore && \
task deps && \
task build GOOS=linux GOARCH=arm64 && \
mkdir /out && \
mv ./bin/semaphore /out
# runtime
FROM ghcr.io/imagegenius/baseimage-alpine:arm64v8-3.19
# set version label
ARG BUILD_DATE
ARG VERSION
ARG SEMAPHORE_VERSION
LABEL build_version="ImageGenius Version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="hydazz"
# environment settings
ENV SEMAPHORE_TMP_PATH="/tmp/semaphore" \
SEMAPHORE_CONFIG_PATH="/config" \
SEMAPHORE_DB_PATH="/config" \
ANSIBLE_HOST_KEY_CHECKING=False
ENV ANSIBLE_VERSION=9.4.0
COPY --from=builder /out/* /usr/local/bin/
RUN \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
build-base \
libffi-dev \
openssl-dev \
python3-dev && \
echo "**** install runtime packages ****" && \
apk add --no-cache \
curl-dev \
g++ \
gcc \
git \
mysql-client \
nodejs \
npm \
openssh-client-default \
openssl \
py-openssl \
py3-pip \
py3-virtualenv \
rsync \
sshpass && \
curl -o \
/usr/local/bin/server-wrapper -L \
"https://raw.githubusercontent.com/semaphoreui/semaphore/develop/deployment/docker/server/server-wrapper" && \
chmod +x \
/usr/local/bin/server-wrapper && \
mkdir -p \
/tmp/semaphore/ && \
curl -o \
/tmp/semaphore/ansible.cfg -L \
"https://raw.githubusercontent.com/semaphoreui/semaphore/develop/deployment/docker/server/ansible.cfg" && \
python3 -m venv /lsiopy && \
pip3 install -U --no-cache \
pip && \
pip3 install --no-cache \
ansible==${ANSIBLE_VERSION} \
boto3 \
botocore \
netaddr \
passlib \
requests && \
echo "**** cleanup ****" && \
for cleanfiles in *.pyc *.pyo; do \
find /usr/lib/python3.* -iname "${cleanfiles}" -delete; \
done && \
apk del --purge \
build-dependencies && \
rm -rf \
/tmp/*
# set home
ENV HOME=/config
# copy local files
COPY root/ /
# ports and volumes
EXPOSE 3000
VOLUME /config