Skip to content

Commit 4afdc5e

Browse files
committed
install aptly 1.6.0 on debian bookworm
- based on debian:bookworm-slim - install from new repos - cleanup and reduce image size
1 parent e8bca2d commit 4afdc5e

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

Dockerfile

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,31 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
FROM debian:buster
17+
FROM debian:bookworm-slim
1818

1919
LABEL maintainer="[email protected]"
2020

2121
ARG DEBIAN_FRONTEND=noninteractive
2222

2323
# Update APT repository & install packages (except aptly)
2424
RUN apt-get -q update \
25-
&& apt-get -y install \
26-
bzip2 \
27-
gnupg2 \
28-
gpgv \
25+
&& apt-get -y --no-install-recommends install \
2926
graphviz \
3027
supervisor \
3128
nginx \
3229
curl \
33-
xz-utils \
3430
apt-utils \
3531
gettext-base \
36-
bash-completion
32+
bash-completion \
33+
gpg-agent \
34+
ca-certificates
3735

38-
RUN curl -sL https://www.aptly.info/pubkey.txt | gpg --dearmor | tee /etc/apt/trusted.gpg.d/aptly.gpg >/dev/null \
39-
&& echo "deb http://repo.aptly.info/ squeeze main" >> /etc/apt/sources.list
36+
RUN curl -sL -o /etc/apt/keyrings/aptly.asc http://www.aptly.info/pubkey.txt
37+
RUN echo "deb [signed-by=/etc/apt/keyrings/aptly.asc] http://repo.aptly.info/release bookworm main" > /etc/apt/sources.list.d/aptly.list
4038

4139
# Install aptly package
4240
RUN apt-get -q update \
43-
&& apt-get -y install aptly=1.6.0 \
41+
&& apt-get -y --no-install-recommends install aptly=1.6.0 \
4442
&& apt-get clean \
4543
&& rm -rf /var/lib/apt/lists/*
4644

@@ -59,8 +57,6 @@ COPY assets/supervisord.web.conf /etc/supervisor/conf.d/web.conf
5957
# Install scripts
6058
COPY assets/*.sh /opt/
6159

62-
ADD https://raw.githubusercontent.com/aptly-dev/aptly/v1.6.0/completion.d/aptly /usr/share/bash-completion/completions/aptly
63-
6460
RUN echo "if ! shopt -oq posix; then\n\
6561
if [ -f /usr/share/bash-completion/bash_completion ]; then\n\
6662
. /usr/share/bash-completion/bash_completion\n\

assets/keys_gen.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if [[ ! -d /opt/aptly/gpg/private-keys-v1.d/ ]] || [[ ! -f /opt/aptly/gpg/pubrin
2424

2525
# If your system doesn't have a lot of entropy this may, take a long time
2626
# Google how-to create "artificial" entropy, if this gets stuck
27-
gpg2 --batch --passphrase "${GPG_PASSPHRASE}" --quick-gen-key "${FULL_NAME} <${EMAIL_ADDRESS}>" default default 0
27+
gpg --batch --passphrase "${GPG_PASSPHRASE}" --quick-gen-key "${FULL_NAME} <${EMAIL_ADDRESS}>" default default 0
2828
else
2929
echo "No need to generate the new GPG keypair"
3030
fi
@@ -37,8 +37,8 @@ if [[ ! -d /opt/aptly/public ]] ||
3737
mkdir -p /opt/aptly/public
3838
# Export only all public keys,
3939
# for export private keys use --export-secret-keys
40-
gpg2 --export --armor > /opt/aptly/public/repo_signing.key
41-
gpg2 --export > /opt/aptly/public/repo_signing.gpg
40+
gpg --export --armor > /opt/aptly/public/repo_signing.key
41+
gpg --export > /opt/aptly/public/repo_signing.gpg
4242
else
4343
echo "No need to export the GPG keys"
4444
fi

0 commit comments

Comments
 (0)