Skip to content

Commit

Permalink
feat docker: build dockerfile for 24.04
Browse files Browse the repository at this point in the history
commit_hash:63277d89e093a113871b6f9c9a4eadb9c08636f6
  • Loading branch information
segoon committed Jan 24, 2025
1 parent a5f92cc commit b54347f
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -3436,6 +3436,7 @@
"scripts/build_and_install.sh":"taxi/uservices/userver/scripts/build_and_install.sh",
"scripts/build_and_install_all.sh":"taxi/uservices/userver/scripts/build_and_install_all.sh",
"scripts/chaotic/requirements.txt":"taxi/uservices/userver/scripts/chaotic/requirements.txt",
"scripts/clickhouse/ubuntu-install-clickhouse.sh":"taxi/uservices/userver/scripts/clickhouse/ubuntu-install-clickhouse.sh",
"scripts/docker/Readme.md":"taxi/uservices/userver/scripts/docker/Readme.md",
"scripts/docker/base-debian-11.dockerfile":"taxi/uservices/userver/scripts/docker/base-debian-11.dockerfile",
"scripts/docker/base-ubuntu-22.04-ci.dockerfile":"taxi/uservices/userver/scripts/docker/base-ubuntu-22.04-ci.dockerfile",
Expand All @@ -3449,6 +3450,7 @@
"scripts/docker/ubuntu-22.04-pg-dev.dockerfile":"taxi/uservices/userver/scripts/docker/ubuntu-22.04-pg-dev.dockerfile",
"scripts/docker/ubuntu-22.04-pg.dockerfile":"taxi/uservices/userver/scripts/docker/ubuntu-22.04-pg.dockerfile",
"scripts/docker/ubuntu-22.04.dockerfile":"taxi/uservices/userver/scripts/docker/ubuntu-22.04.dockerfile",
"scripts/docker/ubuntu-24.04-base.dockerfile":"taxi/uservices/userver/scripts/docker/ubuntu-24.04-base.dockerfile",
"scripts/docs/README.md":"taxi/uservices/userver/scripts/docs/README.md",
"scripts/docs/customdoxygen.css":"taxi/uservices/userver/scripts/docs/customdoxygen.css",
"scripts/docs/doxygen-awesome-css/README.md":"taxi/uservices/userver/scripts/docs/doxygen-awesome-css/README.md",
Expand Down Expand Up @@ -3663,6 +3665,8 @@
"scripts/migrate_from_legacy_redis_ns.sh":"taxi/uservices/userver/scripts/migrate_from_legacy_redis_ns.sh",
"scripts/perf-blocking-syscall":"taxi/uservices/userver/scripts/perf-blocking-syscall",
"scripts/postgres/pg_sql_codes.py":"taxi/uservices/userver/scripts/postgres/pg_sql_codes.py",
"scripts/postgres/ubuntu-install-postgresql-includes.sh":"taxi/uservices/userver/scripts/postgres/ubuntu-install-postgresql-includes.sh",
"scripts/rabbitmq/ubuntu_install_rabbitmq_dev.sh":"taxi/uservices/userver/scripts/rabbitmq/ubuntu_install_rabbitmq_dev.sh",
"scripts/rabbitmq/ubuntu_install_rabbitmq_server.sh":"taxi/uservices/userver/scripts/rabbitmq/ubuntu_install_rabbitmq_server.sh",
"scripts/sql/__init__.py":"taxi/uservices/userver/scripts/sql/__init__.py",
"scripts/sql/generator.py":"taxi/uservices/userver/scripts/sql/generator.py",
Expand Down
12 changes: 12 additions & 0 deletions scripts/clickhouse/ubuntu-install-clickhouse.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# Exit on any error and treat unset variables as errors, print all commands
set -euox pipefail

CLICKHOUSE_VERSION=${CLICKHOUSE_VERSION:=v2.5.1}

# Installing Clickhouse C++ client libraries from sources
git clone --depth 1 -b ${CLICKHOUSE_VERSION} https://github.com/ClickHouse/clickhouse-cpp.git
(cd clickhouse-cpp && mkdir build && cd build && \
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release .. && make -j $(nproc) && make install)
rm -rf clickhouse-cpp/
2 changes: 2 additions & 0 deletions scripts/docker/base-ubuntu-22.04.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ FROM ubuntu:22.04

COPY scripts/docs/en/deps/ubuntu-22.04.md /userver_tmp/
COPY scripts/docker/setup-base-ubuntu-22.04-env.sh /userver_tmp/
COPY scripts/clickhouse/ubuntu-install-clickhouse.sh /userver_tmp/
COPY scripts/rabbitmq/ubuntu_install_rabbitmq_dev.sh /userver_tmp/

COPY scripts/grpc/requirements-3.txt /userver_tmp/requirements/grpc-userver.txt
COPY scripts/chaotic/requirements.txt /userver_tmp/requirements/chaotic.txt
Expand Down
15 changes: 6 additions & 9 deletions scripts/docker/setup-base-ubuntu-22.04-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,16 @@ rm -rf postgresql-server-dev-14* tmp_postgresql
apt clean all

# You could override those versions from command line
AMQP_VERSION=${AMQP_VERSION:=v4.3.18}
CLICKHOUSE_VERSION=${CLICKHOUSE_VERSION:=v2.3.0}
ROCKSDB_VERSION=${ROCKSDB_VERSION:=v8.9.1}
export AMQP_VERSION=${AMQP_VERSION:=v4.3.18}
export CLICKHOUSE_VERSION=${CLICKHOUSE_VERSION:=v2.5.1}
export ROCKSDB_VERSION=${ROCKSDB_VERSION:=v8.9.1}
export POSTGRESQL_VERSION=${POSTGRESQL_VERSION:=14}

# Installing amqp/rabbitmq client libraries from sources
git clone --depth 1 -b ${AMQP_VERSION} https://github.com/CopernicaMarketingSoftware/AMQP-CPP.git amqp-cpp
(cd amqp-cpp && mkdir build && cd build && \
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release .. && make -j $(nproc) && make install)
./ubuntu_install_rabbitmq_dev.sh

# Installing Clickhouse C++ client libraries from sources
git clone --depth 1 -b ${CLICKHOUSE_VERSION} https://github.com/ClickHouse/clickhouse-cpp.git
(cd clickhouse-cpp && mkdir build && cd build && \
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release .. && make -j $(nproc) && make install)
./ubuntu-install-clickhouse.sh

# Installing RocksDB client libraries from sources
git clone --depth 1 -b ${ROCKSDB_VERSION} https://github.com/facebook/rocksdb
Expand Down
33 changes: 33 additions & 0 deletions scripts/docker/ubuntu-24.04-base.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM ubuntu:24.04

COPY scripts/docs/en/deps/ubuntu-24.04.md /userver_tmp/
COPY scripts/postgres/ubuntu-install-postgresql-includes.sh /userver_tmp/

RUN apt update \
&& apt install -y $(cat /userver_tmp/ubuntu-24.04.md) \
&& apt install -y clang-format python3-pip \
&& apt install -y \
clickhouse-server \
mariadb-server \
postgresql-16 \
rabbitmq-server \
redis-server \
&& apt install -y locales \
&& apt clean all \
&& /userver_tmp/ubuntu-install-postgresql-includes.sh

RUN \
# Set UTC timezone \
TZ=Etc/UTC; \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
\
# Generate locales \
&& locale-gen en_US.UTF-8 \
&& update-locale LC_ALL="en_US.UTF-8" LANG="en_US.UTF-8" LANGUAGE="en_US.UTF-8"


COPY scripts/clickhouse/ubuntu-install-clickhouse.sh /userver_tmp/
RUN /userver_tmp/ubuntu-install-clickhouse.sh

COPY scripts/rabbitmq/ubuntu_install_rabbitmq_dev.sh /userver_tmp/
RUN /userver_tmp/ubuntu_install_rabbitmq_dev.sh
17 changes: 17 additions & 0 deletions scripts/postgres/ubuntu-install-postgresql-includes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# Exit on any error and treat unset variables as errors, print all commands
set -euox pipefail

POSTGRESQL_VERSION=${POSTGRESQL_VERSION:=16}

apt remove postgresql-server-dev-${POSTGRESQL_VERSION}

# Installing postgresql-server-dev-14 without dependencies
#
# We should feel sorry because of that but we don't. The package
# pulls in ~700MB of unnecessary dependencies.
apt download postgresql-server-dev-${POSTGRESQL_VERSION}
dpkg-deb -R postgresql-server-dev-${POSTGRESQL_VERSION}* tmp_postgresql
cp -r tmp_postgresql/usr/* /usr/
rm -rf postgresql-server-dev-${POSTGRESQL_VERSION}* tmp_postgresql
12 changes: 12 additions & 0 deletions scripts/rabbitmq/ubuntu_install_rabbitmq_dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# Exit on any error and treat unset variables as errors, print all commands
set -euox pipefail

AMQP_VERSION=${AMQP_VERSION:=v4.3.18}

# Installing amqp/rabbitmq client libraries from sources
git clone --depth 1 -b ${AMQP_VERSION} https://github.com/CopernicaMarketingSoftware/AMQP-CPP.git amqp-cpp
(cd amqp-cpp && mkdir build && cd build && \
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release .. && make -j $(nproc) && make install)
rm -rf amqp-cpp/

0 comments on commit b54347f

Please sign in to comment.