Skip to content

Commit 87f0174

Browse files
committed
[FIX] Odoo 10.0-12.0: use a more secure way to download keys
At build time, curl is used to download gnupg keys without any verification. This does not meet the Docker hub requirements: https://github.com/docker-library/official-images#security With this commit, gpg is used to download the keys with the best method specified in the requirements.
1 parent 4ab6185 commit 87f0174

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

10.0/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ RUN set -x; \
77
&& apt-get install -y --no-install-recommends \
88
ca-certificates \
99
curl \
10+
dirmngr \
1011
node-less \
1112
python-gevent \
1213
python-ldap \
@@ -27,7 +28,10 @@ RUN set -x; \
2728
# install latest postgresql-client
2829
RUN set -x; \
2930
echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' > etc/apt/sources.list.d/pgdg.list \
30-
&& curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
31+
&& export GNUPGHOME="$(mktemp -d)" \
32+
&& gpg --batch --keyserver keyserver.ubuntu.com --recv-keys ACCC4CF8 \
33+
&& gpg --armor --export ACCC4CF8 | apt-key add - \
34+
&& rm -rf "$GNUPGHOME" \
3135
&& apt-get update \
3236
&& apt-get install -y postgresql-client
3337

11.0/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ RUN set -x; \
1010
&& apt-get install -y --no-install-recommends \
1111
ca-certificates \
1212
curl \
13+
dirmngr \
1314
fonts-noto-cjk \
1415
gnupg \
1516
libssl1.0-dev \
@@ -31,7 +32,11 @@ RUN set -x; \
3132
# install latest postgresql-client
3233
RUN set -x; \
3334
echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' > etc/apt/sources.list.d/pgdg.list \
34-
&& curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
35+
&& export GNUPGHOME="$(mktemp -d)" \
36+
&& gpg --batch --keyserver keyserver.ubuntu.com --recv-keys ACCC4CF8 \
37+
&& gpg --armor --export ACCC4CF8 | apt-key add - \
38+
&& gpgconf --kill all \
39+
&& rm -rf "$GNUPGHOME" \
3540
&& apt-get update \
3641
&& apt-get install -y postgresql-client
3742

12.0/Dockerfile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ RUN set -x; \
1010
&& apt-get install -y --no-install-recommends \
1111
ca-certificates \
1212
curl \
13+
dirmngr \
1314
fonts-noto-cjk \
1415
gnupg \
1516
libssl1.0-dev \
@@ -31,14 +32,22 @@ RUN set -x; \
3132
# install latest postgresql-client
3233
RUN set -x; \
3334
echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' > etc/apt/sources.list.d/pgdg.list \
34-
&& curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
35+
&& export GNUPGHOME="$(mktemp -d)" \
36+
&& gpg --batch --keyserver keyserver.ubuntu.com --recv-keys ACCC4CF8 \
37+
&& gpg --armor --export ACCC4CF8 | apt-key add - \
38+
&& gpgconf --kill all \
39+
&& rm -rf "$GNUPGHOME" \
3540
&& apt-get update \
3641
&& apt-get install -y postgresql-client
3742

3843
# Install rtlcss (on Debian stretch)
3944
RUN set -x;\
40-
curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
41-
&& echo "deb http://deb.nodesource.com/node_8.x stretch main" > /etc/apt/sources.list.d/nodesource.list \
45+
echo "deb http://deb.nodesource.com/node_8.x stretch main" > /etc/apt/sources.list.d/nodesource.list \
46+
&& export GNUPGHOME="$(mktemp -d)" \
47+
&& gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 68576280 \
48+
&& gpg --armor --export 68576280 | apt-key add - \
49+
&& gpgconf --kill all \
50+
&& rm -rf "$GNUPGHOME" \
4251
&& apt-get update \
4352
&& apt-get install -y nodejs \
4453
&& npm install -g rtlcss

0 commit comments

Comments
 (0)