Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to build dpkg with Docker #1230

Merged
merged 1 commit into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions config/docker/build_dpkg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
#
# Script to build Debian packages with Docker.

# Fail on error.
set -e

GID=$(id -g);

L2TBUILDS_DIRECTORY="${HOME}/Projects/l2tbuilds";
GNUPG_DIRECTORY="${HOME}/Projects/l2tbuilds-gnupg";

cd config/docker;

mkdir -p "${L2TBUILDS_DIRECTORY}/dpkg";
mkdir -p "${L2TBUILDS_DIRECTORY}/dpkg-source";

# Build the l2tbuilds Ubuntu Docker image.
docker build -f l2tbuilds_ubuntu.Dockerfile --force-rm --no-cache -t log2timeline/l2tbuilds_ubuntu . ;

if test -d "${GNUPG_DIRECTORY}";
then
# Run the container in interactive mode ("run -it") to use gpg-agent to sign the builds
docker run -it -u ${UID}:${GID} -v "${GNUPG_DIRECTORY}:/home/ubuntu/.gnupg:z" -v "${L2TBUILDS_DIRECTORY}:/home/build/l2tbuilds:z" log2timeline/l2tbuilds_ubuntu
else
docker run -u ${UID}:${GID} -v "${L2TBUILDS_DIRECTORY}:/home/build/l2tbuilds:z" log2timeline/l2tbuilds_ubuntu /bin/bash -c "(cd l2tdevtools && ./utils/build_dpkg.sh --preset plaso)"
fi

71 changes: 71 additions & 0 deletions config/docker/l2tbuilds_ubuntu.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
FROM ubuntu:noble
MAINTAINER Log2Timeline <[email protected]>

# Create container with:
# docker build -f l2tbuilds_ubuntu.Dockerfile --force-rm --no-cache -t log2timeline/l2tbuilds_ubuntu .

ENV DEBIAN_FRONTEND=noninteractive

# Combining the apt-get commands into a single run reduces the size of the resulting image.
# The apt-get installations below are interdependent and need to be done in sequence.
RUN apt-get -y update && \
apt-get -y install apt-transport-https apt-utils && \
apt-get -y install libterm-readline-gnu-perl software-properties-common && \
apt-get -y upgrade && \
apt-get -y install --no-install-recommends \
autoconf \
automake \
autopoint \
build-essential \
byacc \
cython3 \
debhelper \
devscripts \
dh-autoreconf \
dh-python \
dput \
fakeroot \
flex \
git \
gnupg2 \
libdistro-info-perl \
libbz2-dev \
libffi-dev \
libfuse-dev \
liblzma-dev \
libmagic-dev \
libssl-dev \
libtool \
libyaml-dev \
locales \
pkg-config \
pinentry-tty \
python3-all \
python3-all-dev \
python3-cffi \
python3-packaging \
python3-pbr \
python3-pkgconfig \
python3-poetry-core \
python3-pytest \
python3-pytest-runner \
python3-setuptools \
python3-setuptools-scm \
python3-toml \
python3-wheel \
quilt \
tox-current-env && \
apt-get clean && rm -rf /var/cache/apt/* /var/lib/apt/lists/*

# Set terminal to UTF-8 by default
RUN locale-gen en_US.UTF-8
RUN update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8

# Changes pinentry to use TTY
RUN update-alternatives --set pinentry /usr/bin/pinentry-tty

# Set up the l2tdevtools source and build directories
WORKDIR /home/build/
RUN git clone https://github.com/log2timeline/l2tdevtools.git
4 changes: 2 additions & 2 deletions data/projects.ini
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ description_long: Discover and load entry points from installed packages

[fakeredis]
version: >=1.1.0
dpkg_build_dependencies: python3-poetry-core,python3-tox-current-env
dpkg_build_dependencies: python3-poetry-core,tox-current-env
build_system: poetry
rpm_template_spec: fakeredis.spec
maintainer: Daniel Moran <[email protected]>
Expand Down Expand Up @@ -2130,7 +2130,7 @@ disabled: windows
version: >=0.9.7
dpkg_build_dependencies: python3-cffi,python3-setuptools,python3-toml,python3-wheel
dpkg_name: python-xattr
rpm_build_dependencies: python3-cffi,python3-pip,python3-setuptools,python3-tox-current-env,python3-wheel
rpm_build_dependencies: python3-cffi,python3-pip,python3-setuptools,python3-wheel,tox-current-env
rpm_name: python-xattr
rpm_template_spec: xattr.spec
maintainer: John Machin <[email protected]>
Expand Down
Loading