2024-06-10 12:54:34 +03:00
|
|
|
# DATE VERSION: 2024-06-10
|
2022-10-18 16:25:59 +03:00
|
|
|
# Modify the above date version (YYYY-MM-DD) if you want to rebuild the image
|
2023-06-20 12:33:43 +03:00
|
|
|
|
2024-06-10 12:54:34 +03:00
|
|
|
FROM ubuntu:jammy-20240530
|
2022-10-05 12:06:14 +03:00
|
|
|
|
|
|
|
### NOTE! Shared libraries here need to be kept in sync with `server-builder.dockerfile`!
|
2022-03-22 15:02:12 +03:00
|
|
|
|
|
|
|
# TARGETPLATFORM is automatically set up by docker buildx based on the platform we are targetting for
|
|
|
|
ARG TARGETPLATFORM
|
|
|
|
|
|
|
|
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
|
|
|
|
|
2022-10-03 16:15:38 +03:00
|
|
|
RUN set -ex; \
|
|
|
|
groupadd -g 1001 hasura; \
|
|
|
|
useradd -m -u 1001 -g hasura hasura
|
2022-03-22 15:02:12 +03:00
|
|
|
|
2022-10-03 16:15:38 +03:00
|
|
|
RUN set -ex; \
|
|
|
|
apt-get update; \
|
2023-06-20 12:33:43 +03:00
|
|
|
apt-get upgrade -y; \
|
2023-07-12 13:16:45 +03:00
|
|
|
# basic deps
|
|
|
|
apt-get install -y apt-transport-https ca-certificates curl gnupg2 lsb-release; \
|
|
|
|
# deps needed for graphql-engine
|
|
|
|
apt-get install -y libkrb5-3 libpq5 libnuma1 unixodbc-dev; \
|
|
|
|
# deps needed for cli-migrations
|
|
|
|
apt-get install -y netcat
|
2022-03-22 15:02:12 +03:00
|
|
|
|
2022-10-21 19:23:01 +03:00
|
|
|
RUN set -ex; \
|
2023-06-20 12:33:43 +03:00
|
|
|
curl -fsS "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list" > /etc/apt/sources.list.d/mssql-release.list; \
|
|
|
|
curl -fsS 'https://packages.microsoft.com/keys/microsoft.asc' | apt-key add -; \
|
2022-10-21 19:23:01 +03:00
|
|
|
apt-get update; \
|
|
|
|
ACCEPT_EULA=Y apt-get install -y msodbcsql18; \
|
|
|
|
if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
|
|
|
|
# Support the old version of the driver too, where possible.
|
|
|
|
# v17 is only supported on amd64.
|
|
|
|
ACCEPT_EULA=Y apt-get -y install msodbcsql17; \
|
2022-03-22 15:02:12 +03:00
|
|
|
fi
|
|
|
|
|
2022-04-18 09:24:03 +03:00
|
|
|
# Install pg_dump
|
2022-10-03 16:15:38 +03:00
|
|
|
RUN set -ex; \
|
|
|
|
curl -s https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -; \
|
2023-06-20 12:33:43 +03:00
|
|
|
echo 'deb http://apt.postgresql.org/pub/repos/apt jammy-pgdg main' > /etc/apt/sources.list.d/pgdg.list; \
|
2022-10-03 16:15:38 +03:00
|
|
|
apt-get -y update; \
|
2023-11-20 17:07:27 +03:00
|
|
|
apt-get install -y postgresql-client-16; \
|
2022-10-03 16:15:38 +03:00
|
|
|
# delete all pg tools except pg_dump to keep the image minimal
|
|
|
|
find /usr/bin -name 'pg*' -not -path '/usr/bin/pg_dump' -delete
|
2022-04-18 09:24:03 +03:00
|
|
|
|
2022-03-22 15:02:12 +03:00
|
|
|
# Cleanup unwanted files and packages
|
2023-01-31 10:31:12 +03:00
|
|
|
# Note: curl is not removed, it's required to support health checks
|
2022-10-03 16:15:38 +03:00
|
|
|
RUN set -ex; \
|
2023-01-31 10:31:12 +03:00
|
|
|
apt-get -y remove gnupg2; \
|
2022-10-03 16:15:38 +03:00
|
|
|
apt-get -y auto-remove; \
|
|
|
|
apt-get -y clean; \
|
|
|
|
rm -rf /var/lib/apt/lists/* /usr/share/doc/ /usr/share/man/ /usr/share/locale/
|