Skip to content

Commit

Permalink
Move Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
OzzyCzech committed Mar 19, 2024
1 parent 477ad1a commit d87e0e4
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 46 deletions.
88 changes: 42 additions & 46 deletions .docker/minicrawler/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,52 +1,48 @@
FROM debian:latest
FROM debian:bookworm-slim as minicrawler

ENV LANGUAGE en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL C
ENV DEBIAN_FRONTEND noninteractive

ENV CFLAGS "-O3 -g -fstack-protector-strong"

RUN apt-get -qqy update && apt-get -qqy install \
# minicrawler dev deps
libc-ares-dev \
zlib1g-dev \
libicu-dev \
libssl-dev \
libnghttp2-dev \
\
# build tool
make \
autoconf \
automake \
autotools-dev \
build-essential \
libtool \
gcc \
\
# php for testing
php \
\
# tools
curl \
ca-certificates \
apt-transport-https \
locales \
tzdata \
\
&& sed -i 's/^.*\(en_US.UTF-8\)/\1/' /etc/locale.gen \
&& locale-gen \
&& ln -sf "/usr/share/zoneinfo/Europe/Prague" /etc/localtime && dpkg-reconfigure tzdata \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* \
# update certificates \
&& mkdir -p /var/lib/certs \
&& curl -s -f -L https://curl.se/ca/cacert.pem -o ca-bundle.crt \
&& cat /etc/ssl/certs/ca-certificates.crt >> ca-bundle.crt \
&& cp -v ca-bundle.crt /var/lib/certs/ca-bundle.crt
ENV DEBIAN_FRONTEND=noninteractive

RUN apt update && apt -y install \
# minicrawler dev deps
libc-ares-dev \
zlib1g-dev \
libicu-dev \
libssl-dev \
libnghttp2-dev \
\
# build tool
make \
autoconf \
automake \
autotools-dev \
build-essential \
libtool \
gcc \
\
# tools
curl \
ca-certificates \
apt-transport-https \
locales \
tzdata \
\
&& sed -i 's/^.*\(en_US.UTF-8\)/\1/' /etc/locale.gen \
&& locale-gen \
&& ln -sf "/usr/share/zoneinfo/Europe/Prague" /etc/localtime && dpkg-reconfigure tzdata \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* \
# update certificates \
&& mkdir -p /var/lib/certs \
&& curl -s -f -L https://curl.se/ca/cacert.pem -o ca-bundle.crt \
&& cat /etc/ssl/certs/ca-certificates.crt >> ca-bundle.crt \
&& cp -v ca-bundle.crt /var/lib/certs/ca-bundle.crt

ENV LC_ALL en_US.UTF-8

ARG PREFIX="/var/lib/minicrawler/usr"
# copy minicrawler source
WORKDIR /minicrawler
COPY . /minicrawler

WORKDIR /minicrawler
RUN ./autogen.sh \
&& ./configure --prefix=/var/lib/minicrawler/usr --with-ca-bundle=/var/lib/certs/ca-bundle.crt --with-ca-path=/etc/ssl/certs \
&& make || exit 42 \
&& make install || exit 43
29 changes: 29 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Define the Docker Compose services block
# https://docs.docker.com/build/bake/reference/

####################################################################################################
# docker buildx bake --file docker-bake.hcl minicrawler --push --no-cache --progress=plain
####################################################################################################

target "minicrawler" {
args = {
MINICRAWLER_VERSION = "v5.2.6"
}
context = "git@gitlab.int.wikidi.net:testomato/minicrawler.git"
dockerfile = ".docker/minicrawler/Dockerfile"
platforms = ["linux/amd64", "linux/arm64"]
ssh = ["default"]
pull = true
tags = [
"dr.brzy.cz/testomato/minicrawler:latest",
"dr.brzy.cz/testomato/minicrawler:v5.2.6",
]
}

####################################################################################################
# docker buildx bake --file docker-bake.hcl --push --no-cache --progress=plain
####################################################################################################

group "default" {
targets = ["minicrawler"]
}

0 comments on commit d87e0e4

Please sign in to comment.