-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
59 lines (48 loc) · 1.42 KB
/
Copy pathDockerfile
File metadata and controls
59 lines (48 loc) · 1.42 KB
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
# Use a base image (e.g., Ubuntu)
FROM ubuntu:20.04
# Set environment variable to avoid tzdata prompts
ENV DEBIAN_FRONTEND=noninteractive
# Install necessary packages, including libgpg-error and virtualenv
RUN apt-get update && \
apt-get install -y \
build-essential \
autoconf \
automake \
libtool \
pkg-config \
python3 \
python3-pip \
wget \
git \
libgpg-error-dev \
gpg-agent \
tzdata \
python3-venv \
pinentry-tty \
&& apt-get clean
# Clone and install Libgcrypt 1.8.4
RUN git clone --branch LIBGCRYPT-1.8-BRANCH https://github.com/gpg/libgcrypt.git && \
cd libgcrypt && \
./autogen.sh && \
./configure --disable-doc && \
make && \
make install && \
ldconfig
# Clean up
RUN rm -rf libgcrypt
# Configure GPG for non-interactive mode
RUN mkdir -p /root/.gnupg && \
echo "use-agent" >> /root/.gnupg/gpg.conf && \
echo "pinentry-program /usr/bin/pinentry-tty" >> /root/.gnupg/gpg-agent.conf && \
chmod 700 /root/.gnupg
# Set the working directory
WORKDIR /app
# Copy your Python code to the container
COPY . .
COPY libgcrypt_wrapper.py .
# Create a virtual environment and install Python dependencies
RUN python3 -m venv venv && \
. venv/bin/activate && \
pip install --no-cache-dir -r requirements.txt
# Set the entrypoint to use the virtual environment
CMD ["/bin/bash", "-c", "source venv/bin/activate && python3 repeated_signings.py"]