File tree Expand file tree Collapse file tree 4 files changed +64
-21
lines changed
Expand file tree Collapse file tree 4 files changed +64
-21
lines changed Original file line number Diff line number Diff line change 1+ .git
2+
Original file line number Diff line number Diff line change 1+ FROM centos:7
2+
3+ ARG GNUPG_VERSION=latest
4+ ARG CONFIGURE_OPTS="--enable-gpg2-is-gpg"
5+
6+ RUN yum install -y bzip2 gcc make sudo ncurses-devel
7+
8+ WORKDIR /usr/local/src/gpg-build-scripts
9+ COPY . .
10+ RUN ./install_gpg_all.sh --suite-version "${GNUPG_VERSION}" --sudo --configure-opts "${CONFIGURE_OPTS}"
11+
12+ WORKDIR /root
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e # Early exit if any command returns non-zero status code
4+ set -v # Print executed lines
5+
6+ # This example shows how to use GnuPG Docker image.
7+
8+ # ##############
9+ # SETUP #
10+ # ##############
11+
12+ docker build -t gnupg:latest --build-arg GNUPG_VERSION=latest .
13+ docker build -t gnupg:2.2 --build-arg GNUPG_VERSION=2.2 .
14+ docker build -t gnupg:2.1 --build-arg GNUPG_VERSION=2.1 .
15+
16+ # ##############
17+ # TESTS #
18+ # ##############
19+
20+ # Assert installed versions…
21+ # (All images are configured to have GnuPG executable at /usr/local/bin/gpg)
22+ docker run -i gnupg:latest gpg --version | head -n 1 | cut -d" " -f 3 | grep -xE " 2\.2\.[0-9]+"
23+ docker run -i gnupg:2.2 gpg --version | head -n 1 | cut -d" " -f 3 | grep -xE " 2\.2\.[0-9]+"
24+ docker run -i gnupg:2.1 gpg --version | head -n 1 | cut -d" " -f 3 | grep -xE " 2\.1\.[0-9]+"
25+
26+ # Assert that it works (is capable of clearsigning files)…
27+ docker run -i gnupg:latest /bin/bash > signed.out << -SH
28+ gpg --gen-key --batch <<-KEY_PARAMS
29+ %no-protection
30+ Key-Type: RSA
31+ Key-Usage: sign, cert
32+ Key-Length: 2048
33+ Subkey-Type: RSA
34+ Subkey-Length: 2048
35+ Subkey-Usage: encrypt
36+ Name-Real: Some User
37+ 38+ Name-Comment: Without passphrase
39+ Expire-Date: 0
40+ KEY_PARAMS
41+
42+ echo "it is very important" > ~/important.txt
43+
44+ gpg --clearsign ~/important.txt
45+
46+ cat ~/important.txt.asc
47+ SH
48+
49+ grep signed.out -xe " -----BEGIN PGP SIGNED MESSAGE-----"
50+ grep signed.out -xe " it is very important"
You can’t perform that action at this time.
0 commit comments