-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
40 lines (32 loc) · 1.14 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
29
30
31
32
33
34
35
36
37
38
39
40
FROM python:3-alpine
# Upgrade pip to latest version
RUN pip install --no-cache-dir --upgrade pip
# Copy & install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy all Python scripts to /usr/local/bin
COPY *.py /usr/local/bin/
# Env variables for Docker binary download
ENV DOCKER_CHANNEL=stable
ENV DOCKER_VERSION=27.5.1
# Install required packages and Docker CLI
RUN apk add --no-cache \
iptables \
wget \
ca-certificates \
git \
bash && \
update-ca-certificates && \
wget -q -O - "https://download.docker.com/linux/static/${DOCKER_CHANNEL}/x86_64/docker-${DOCKER_VERSION}.tgz" | \
tar -xzC /usr/local/bin/ --strip-components 1 && \
addgroup -S dockremap && \
adduser -S -G dockremap dockremap && \
echo 'dockremap:165536:65536' >> /etc/subuid && \
echo 'dockremap:165536:65536' >> /etc/subgid
# Copy the entrypoint script
COPY entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh
# volume declaration for Docker data
VOLUME ["/var/lib/docker"]
# Set the container entrypoint
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]