-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
56 lines (46 loc) · 1003 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
FROM mirror.gcr.io/library/alpine:latest
# Install base tools
RUN apk update && apk add --no-cache \
bash \
curl \
wget \
tar \
traceroute \
openssl \
iperf3 \
busybox-extras \
nmap \
netcat-openbsd \
tcpdump \
mtr \
socat \
bind-tools \
iproute2 \
openssh-client \
python3 \
procps \
coreutils \
mongodb-tools \
postgresql15-client \
py3-flask
# Set up build arguments (provided by buildx)
ARG TARGETOS
ARG TARGETARCH
# Set Go version
ENV GO_VERSION=1.22.8
# Compose the correct URL for the architecture
ENV GO_URL=https://dl.google.com/go/go${GO_VERSION}.${TARGETOS}-${TARGETARCH}.tar.gz
# Download and install Go based on target architecture
RUN wget -O go.tar.gz $GO_URL && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
# Set Go path
ENV PATH="/usr/local/go/bin:${PATH}"
# Verify Go installation
RUN go version
# Copy the Flask app
COPY app.py /app.py
# Expose port 5000
EXPOSE 5000
# Run the Flask app
CMD ["python3", "/app.py"]