-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (39 loc) · 1.47 KB
/
Dockerfile
File metadata and controls
55 lines (39 loc) · 1.47 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
# cp -r ~/linux-amd64_deb/ .
# docker build -t phpcades-build .
FROM ubuntu:latest
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
cmake \
libxml2-dev \
build-essential \
libboost-all-dev \
ca-certificates \
php-dev && \
rm -rf /var/lib/apt/lists/*
RUN update-ca-certificates
COPY linux-amd64_deb csp
RUN chmod +x ./csp/install*.sh
RUN ./csp/install.sh
RUN apt-get update && apt-get install -y --no-install-recommends \
./csp/cprocsp-rdr-gui-gtk* \
./csp/lsb-cprocsp-devel* \
./csp/cprocsp-legacy* \
./csp/cprocsp-pki-cades* && \
rm -rf /var/lib/apt/lists/*
RUN git clone https://github.com/CryptoPro/phpcades.git
# for development purposes
# COPY . /phpcades
WORKDIR /phpcades/src
RUN php_dir=$(find /usr/include -name "php.h" 2>/dev/null | xargs dirname | xargs dirname) && \
sed -i "s|/php|$php_dir|" CMakeLists.txt
RUN mkdir build && cd build && \
cmake .. && \
make -j$(nproc)
RUN php_exts=$(php -i | grep 'extension_dir' | cut -d' ' -f3 | xargs) && \
ln -s $(realpath build/libphpcades.so) $php_exts
RUN echo 'extension=libphpcades.so' >> $(php --ini | sed -n 's/^Loaded Configuration File: *//p')
# docker run -it -w /phpcades/samples/ phpcades-build
# /opt/cprocsp/bin/amd64/cryptcp -createcert -dn "CN=test" -provtype 80 -cont '\\.\HDIMAGE\test' -ca https://cryptopro.ru/certsrv
# php test_extension.php