Closed davidcr01 closed 1 year ago
Thank you for reporting this @davidcr01 as well as providing a potential workarounds. I ran:
sed -i 's/deb http/deb [trusted=yes] http/g' wazuh-packages/debs/Debian/amd64/Dockerfile
to work around this issue, but the solution will of course be to base the container on a supported version of Debian.
If --force-yes
is added to the Dockerfile
when installing apt-utils
, the same error appears the next time apt-get
is called, in apt-get build-deps python3.2 -y
.
New Dockerfile
:
RUN echo "deb http://archive.debian.org/debian/ wheezy contrib main non-free" > /etc/apt/sources.list && \
echo "deb-src http://archive.debian.org/debian/ wheezy contrib main non-free" >> /etc/apt/sources.list && \
apt-get update && apt-get install -y --force-yes apt-utils && \
apt-get install -y --force-yes \
curl gcc-multilib make wget sudo expect gnupg perl-base=5.14.2-21+deb7u3 \
perl libc-bin=2.13-38+deb7u10 libc6=2.13-38+deb7u10 libc6-dev \
build-essential cdbs devscripts equivs automake autoconf libtool \
libaudit-dev selinux-basics util-linux libdb5.1=5.1.29-5 libdb5.1-dev \
libssl1.0.0=1.0.1e-2+deb7u20 gawk libsigsegv2 procps
New error:
E: There are problems and -y was used without --force-yes
E: Failed to process build dependencies
The command '/bin/sh -c apt-get update && apt-get build-dep python3.2 -y' returned a non-zero code: 100
The error is solved in PR https://github.com/wazuh/wazuh-packages/pull/2053 by adding --force-yes
to apt-get install
calls on the DEB
SPECS files for architectures amd64
and i386
.
To test the WPK dockerfile (wpk/common/Dockerfile
), I commented the docker run
command of the package generator and used the following command.
./generate_wpk_package.sh -t windows -b v4.3.10 -d /tmp/wpk -k /tmp/keys -o WindowsAgent.wpk -pn /tmp/wazuh-agent-4.3.10-1.msi > wpk.log 2>&1
To test the Windows dockerfile (windows/Dockerfile
), I build the image with docker build -t compile_windows_agent ./
.
Log file: windows.log
To test the Debian dockerfiles (debs/<arch>/Dockerfile
), I build the image with ./generate_debian_package.sh -b v4.3.10 --packages-branch v4.3.10 -s /tmp -t manager -a amd64 -r my_rev.
As this test is the same for arm64, i386, armhf, and ppc64le (only changes the used packages), we can assume that these Dockerfiles are correct, based on the test of amd64.
Log file: debian.log
To test the Wazuh dashboard (Debian) dockerfile (stack/dashboard/deb/docker/amd64/Dockerfile
), I build the image with ./build_package.sh -b no
, to avoid creating the base.
Log file: dashboard.log
To test the Wazuh indexer (Debian) dockerfile (stack/indexer/deb/docker/amd64/Dockerfile
), I build the image with ./build_package.sh
.
Log file: indexer.log
Description
An error has been found while generating a Debian package. It seems the docker image can not be created due to expired keys when fetching the wheezy repository.
The example shows the error using
generate_debian_package.sh
, but this error has been detected in other scripts that usewheezy
orjessie
distributions, such as https://github.com/wazuh/wazuh-packages/blob/master/stack/indexer/deb/build_package.shW: GPG error: http://archive.debian.org wheezy Release: The following signatures were invalid: KEYEXPIRED 1587841717 KEYEXPIRED 1668891673 KEYEXPIRED 1557241909
Executing the generation of the image step-by-step it is found that the error is in the
apt-get update && apt-get install -y apt-utils && \
command (line 8 of Dockerfile).https://github.com/wazuh/wazuh-packages/blob/f09df4929222c6d42611e4026be2424dccb29d04/debs/Debian/amd64/Dockerfile#L6-L8
Other options have been used, changing the branch of
-b
and--packages-branch
and removing the--future
option, but the error is not avoided.Tests
I have tried some tests to solve this problem, but some of them did not work and other solutions may not be the best options.
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com <KEY>
--force-yes
to the line that generates the error, theapt-get install
line.[trusted=yes]
in the two previous lines that fetch the Debian repository.Tasks
Validation