diff --git a/CHANGELOG.md b/CHANGELOG.md index de9f77fa5bb..05a5ae3a7e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -161,6 +161,7 @@ function: - console: disable search indexing with HTML meta tag - cli: fix inherited roles metadata not being updated when dropping all roles (#7872) - cli: add support for customization field in sources metadata (#8292) +- ci: ubuntu and centos flavoured graphql-engine images are now available ## v2.4.0-beta.2 diff --git a/cli/Makefile b/cli/Makefile index 93c7e757372..5adbdfa0a5b 100644 --- a/cli/Makefile +++ b/cli/Makefile @@ -68,15 +68,15 @@ copy-cli-ext: clean-cli-ext test: copy-cli-ext echo "--- :: run test" if [ -z "${HASURA_TEST_CLI_HGE_DOCKER_IMAGE}" ]; then echo "Please set HASURA_TEST_CLI_HGE_DOCKER_IMAGE env for populating testutil.HasuraDockerImage and run test"; exit 1; fi - go test -ldflags "-X github.com/hasura/graphql-engine/cli/v2/version.BuildVersion=$(VERSION)" -v -tags="${TEST_TAGS}" `go list ./... | grep -v integration_test | grep -v commands` + go test -count=1 -ldflags "-X github.com/hasura/graphql-engine/cli/v2/version.BuildVersion=$(VERSION)" -v -tags="${TEST_TAGS}" `go list ./... | grep -v integration_test | grep -v commands` integration_tests_config_v3: copy-cli-ext echo "--- :: run integration_tests_config_v3" if [ -z "${HASURA_TEST_CLI_HGE_DOCKER_IMAGE}" ]; then echo "Please set HASURA_TEST_CLI_HGE_DOCKER_IMAGE env for populating testutil.HasuraDockerImage and run test"; exit 1; fi - go test -ldflags "-X github.com/hasura/graphql-engine/cli/v2/version.BuildVersion=$(VERSION)" -v -tags="${TEST_TAGS}" -run Commands/config=v3 ./integration_test + go test -count=1 -ldflags "-X github.com/hasura/graphql-engine/cli/v2/version.BuildVersion=$(VERSION)" -v -tags="${TEST_TAGS}" -run Commands/config=v3 ./integration_test integration_tests_config_v2: copy-cli-ext echo "--- :: run integration_tests_config_v2" if [ -z "${HASURA_TEST_CLI_HGE_DOCKER_IMAGE}" ]; then echo "Please set HASURA_TEST_CLI_HGE_DOCKER_IMAGE env for populating testutil.HasuraDockerImage and run test"; exit 1; fi - go test -ldflags "-X github.com/hasura/graphql-engine/cli/v2/version.BuildVersion=$(VERSION)" -v -tags="${TEST_TAGS}" -run Commands/config=v2 ./integration_test + go test -count=1 -ldflags "-X github.com/hasura/graphql-engine/cli/v2/version.BuildVersion=$(VERSION)" -v -tags="${TEST_TAGS}" -run Commands/config=v2 ./integration_test test-e2e: echo "--- :: run e2e tests" ifndef HAS_GINKGO diff --git a/packaging/README.md b/packaging/README.md new file mode 100644 index 00000000000..389cd92900a --- /dev/null +++ b/packaging/README.md @@ -0,0 +1,25 @@ +# Packaging + +All things related to packaging graphql-engine. + +## hasura/graphql-engine + +([Docker hub](https://hub.docker.com/r/hasura/graphql-engine)) + +Production ready builds of the Hasura graphql-engine. + +Supported tags: +- ``, `latest` +- `.cli-migrations-v2`, `latest.cli-migrations-v2` +- `.cli-migrations-v3`, `latest.cli-migrations-v3` + +## hasura/graphql-engine-base + +([Docker hub](https://hub.docker.com/r/hasura/graphql-engine-base)) + +This acts as base image for building `hasura/graphql-engine` image. + +It is generally published with format `hasura/graphql-engine-base:..` where +- `` is the `sha256sum` of the dockerfile used to build the image +- `OS` is the operating system. It could be any of these values: `debian`, `ubuntu`, `centos` +- `ARCH` is the architecture. It could be any of these values: `amd64`, `arm64` \ No newline at end of file diff --git a/scripts/cli-migrations/Makefile b/packaging/cli-migrations/Makefile similarity index 100% rename from scripts/cli-migrations/Makefile rename to packaging/cli-migrations/Makefile diff --git a/scripts/cli-migrations/v2/.gitignore b/packaging/cli-migrations/v2/.gitignore similarity index 100% rename from scripts/cli-migrations/v2/.gitignore rename to packaging/cli-migrations/v2/.gitignore diff --git a/packaging/cli-migrations/v2/Dockerfile b/packaging/cli-migrations/v2/Dockerfile new file mode 100644 index 00000000000..184bd4af397 --- /dev/null +++ b/packaging/cli-migrations/v2/Dockerfile @@ -0,0 +1,31 @@ +ARG BASE_IMAGE + +FROM ${BASE_IMAGE} + +RUN { apt-get update && apt-get install -y netcat; } \ + || { yum update -y && yum install -y nc; } + +# When a non-root user without home directory is trying to use the cli-migrations image +# then hasura cli will try to create .hasura folder at the root but would fail due to permissions +# (example: OpenShift runs containers by using a random user-id which is homeless and non-root) +# The following commands give the right permissions for /.hasura folder +RUN mkdir -p /.hasura \ + && chgrp -R 0 /.hasura \ + && chmod -R g=u /.hasura + +# set an env var to let the cli know that +# update notification is disabled +ENV HASURA_GRAPHQL_SHOW_UPDATE_NOTIFICATION=false + +COPY docker-entrypoint.sh /bin/ +COPY hasura-cli /bin/hasura-cli + +RUN chmod +x /bin/hasura-cli + +# set an env var to let the cli know that +# it is running in server environment +ENV HASURA_GRAPHQL_CLI_ENVIRONMENT=server-on-docker + +ENTRYPOINT ["docker-entrypoint.sh"] + +CMD ["graphql-engine", "serve"] diff --git a/scripts/cli-migrations/v2/README.md b/packaging/cli-migrations/v2/README.md similarity index 100% rename from scripts/cli-migrations/v2/README.md rename to packaging/cli-migrations/v2/README.md diff --git a/scripts/cli-migrations/v2/docker-entrypoint.sh b/packaging/cli-migrations/v2/docker-entrypoint.sh similarity index 100% rename from scripts/cli-migrations/v2/docker-entrypoint.sh rename to packaging/cli-migrations/v2/docker-entrypoint.sh diff --git a/scripts/cli-migrations/v2/test/docker-compose.yaml b/packaging/cli-migrations/v2/test/docker-compose.yaml similarity index 100% rename from scripts/cli-migrations/v2/test/docker-compose.yaml rename to packaging/cli-migrations/v2/test/docker-compose.yaml diff --git a/scripts/cli-migrations/v2/test/metadata/actions.graphql b/packaging/cli-migrations/v2/test/metadata/actions.graphql similarity index 100% rename from scripts/cli-migrations/v2/test/metadata/actions.graphql rename to packaging/cli-migrations/v2/test/metadata/actions.graphql diff --git a/scripts/cli-migrations/v2/test/metadata/actions.yaml b/packaging/cli-migrations/v2/test/metadata/actions.yaml similarity index 100% rename from scripts/cli-migrations/v2/test/metadata/actions.yaml rename to packaging/cli-migrations/v2/test/metadata/actions.yaml diff --git a/scripts/cli-migrations/v2/test/metadata/allow_list.yaml b/packaging/cli-migrations/v2/test/metadata/allow_list.yaml similarity index 100% rename from scripts/cli-migrations/v2/test/metadata/allow_list.yaml rename to packaging/cli-migrations/v2/test/metadata/allow_list.yaml diff --git a/scripts/cli-migrations/v2/test/metadata/cron_triggers.yaml b/packaging/cli-migrations/v2/test/metadata/cron_triggers.yaml similarity index 100% rename from scripts/cli-migrations/v2/test/metadata/cron_triggers.yaml rename to packaging/cli-migrations/v2/test/metadata/cron_triggers.yaml diff --git a/scripts/cli-migrations/v2/test/metadata/functions.yaml b/packaging/cli-migrations/v2/test/metadata/functions.yaml similarity index 100% rename from scripts/cli-migrations/v2/test/metadata/functions.yaml rename to packaging/cli-migrations/v2/test/metadata/functions.yaml diff --git a/scripts/cli-migrations/v2/test/metadata/query_collections.yaml b/packaging/cli-migrations/v2/test/metadata/query_collections.yaml similarity index 100% rename from scripts/cli-migrations/v2/test/metadata/query_collections.yaml rename to packaging/cli-migrations/v2/test/metadata/query_collections.yaml diff --git a/scripts/cli-migrations/v2/test/metadata/remote_schemas/remote_schemas.yaml b/packaging/cli-migrations/v2/test/metadata/remote_schemas/remote_schemas.yaml similarity index 100% rename from scripts/cli-migrations/v2/test/metadata/remote_schemas/remote_schemas.yaml rename to packaging/cli-migrations/v2/test/metadata/remote_schemas/remote_schemas.yaml diff --git a/scripts/cli-migrations/v2/test/metadata/tables.yaml b/packaging/cli-migrations/v2/test/metadata/tables.yaml similarity index 100% rename from scripts/cli-migrations/v2/test/metadata/tables.yaml rename to packaging/cli-migrations/v2/test/metadata/tables.yaml diff --git a/scripts/cli-migrations/v2/test/metadata/version.yaml b/packaging/cli-migrations/v2/test/metadata/version.yaml similarity index 100% rename from scripts/cli-migrations/v2/test/metadata/version.yaml rename to packaging/cli-migrations/v2/test/metadata/version.yaml diff --git a/scripts/cli-migrations/v2/test/migrations/1586823136625_create_table_public_test/down.sql b/packaging/cli-migrations/v2/test/migrations/1586823136625_create_table_public_test/down.sql similarity index 100% rename from scripts/cli-migrations/v2/test/migrations/1586823136625_create_table_public_test/down.sql rename to packaging/cli-migrations/v2/test/migrations/1586823136625_create_table_public_test/down.sql diff --git a/scripts/cli-migrations/v2/test/migrations/1586823136625_create_table_public_test/up.sql b/packaging/cli-migrations/v2/test/migrations/1586823136625_create_table_public_test/up.sql similarity index 100% rename from scripts/cli-migrations/v2/test/migrations/1586823136625_create_table_public_test/up.sql rename to packaging/cli-migrations/v2/test/migrations/1586823136625_create_table_public_test/up.sql diff --git a/scripts/cli-migrations/v2/test/test-upgrade-from-latest-release.sh b/packaging/cli-migrations/v2/test/test-upgrade-from-latest-release.sh similarity index 100% rename from scripts/cli-migrations/v2/test/test-upgrade-from-latest-release.sh rename to packaging/cli-migrations/v2/test/test-upgrade-from-latest-release.sh diff --git a/scripts/cli-migrations/v2/test/test.sh b/packaging/cli-migrations/v2/test/test.sh similarity index 100% rename from scripts/cli-migrations/v2/test/test.sh rename to packaging/cli-migrations/v2/test/test.sh diff --git a/scripts/cli-migrations/v2/test/validation/metadata.json b/packaging/cli-migrations/v2/test/validation/metadata.json similarity index 100% rename from scripts/cli-migrations/v2/test/validation/metadata.json rename to packaging/cli-migrations/v2/test/validation/metadata.json diff --git a/scripts/cli-migrations/v2/test/validation/schema_migrations.json b/packaging/cli-migrations/v2/test/validation/schema_migrations.json similarity index 100% rename from scripts/cli-migrations/v2/test/validation/schema_migrations.json rename to packaging/cli-migrations/v2/test/validation/schema_migrations.json diff --git a/scripts/cli-migrations/v3/.gitignore b/packaging/cli-migrations/v3/.gitignore similarity index 100% rename from scripts/cli-migrations/v3/.gitignore rename to packaging/cli-migrations/v3/.gitignore diff --git a/packaging/cli-migrations/v3/Dockerfile b/packaging/cli-migrations/v3/Dockerfile new file mode 100644 index 00000000000..fb6517b4378 --- /dev/null +++ b/packaging/cli-migrations/v3/Dockerfile @@ -0,0 +1,31 @@ +ARG BASE_IMAGE + +FROM ${BASE_IMAGE} + +RUN { apt-get update && apt-get install -y netcat; } \ + || { yum update -y && yum install -y nc; } + +# When a non-root user without home directory is trying to use the cli-migrations image +# then hasura cli will try to create .hasura folder at the root but would fail due to permissions +# (example: OpenShift runs containers by using a random user-id which is homeless and non-root) +# The following commands give the right permissions for /.hasura folder +RUN mkdir -p /.hasura \ + && chgrp -R 0 /.hasura \ + && chmod -R g=u /.hasura + +# set an env var to let the cli know that +# update notification is disabled +ENV HASURA_GRAPHQL_SHOW_UPDATE_NOTIFICATION=false + +COPY docker-entrypoint.sh /bin/ +COPY hasura-cli /bin/hasura-cli + +RUN chmod +x /bin/hasura-cli + +# set an env var to let the cli know that +# it is running in server environment +ENV HASURA_GRAPHQL_CLI_ENVIRONMENT=server-on-docker + +ENTRYPOINT ["docker-entrypoint.sh"] + +CMD ["graphql-engine", "serve"] diff --git a/scripts/cli-migrations/v3/README.md b/packaging/cli-migrations/v3/README.md similarity index 100% rename from scripts/cli-migrations/v3/README.md rename to packaging/cli-migrations/v3/README.md diff --git a/scripts/cli-migrations/v3/docker-entrypoint.sh b/packaging/cli-migrations/v3/docker-entrypoint.sh similarity index 100% rename from scripts/cli-migrations/v3/docker-entrypoint.sh rename to packaging/cli-migrations/v3/docker-entrypoint.sh diff --git a/scripts/cli-migrations/v3/test/docker-compose.yaml b/packaging/cli-migrations/v3/test/docker-compose.yaml similarity index 100% rename from scripts/cli-migrations/v3/test/docker-compose.yaml rename to packaging/cli-migrations/v3/test/docker-compose.yaml diff --git a/scripts/cli-migrations/v3/test/metadata/actions.graphql b/packaging/cli-migrations/v3/test/metadata/actions.graphql similarity index 100% rename from scripts/cli-migrations/v3/test/metadata/actions.graphql rename to packaging/cli-migrations/v3/test/metadata/actions.graphql diff --git a/scripts/cli-migrations/v3/test/metadata/actions.yaml b/packaging/cli-migrations/v3/test/metadata/actions.yaml similarity index 100% rename from scripts/cli-migrations/v3/test/metadata/actions.yaml rename to packaging/cli-migrations/v3/test/metadata/actions.yaml diff --git a/scripts/cli-migrations/v3/test/metadata/allow_list.yaml b/packaging/cli-migrations/v3/test/metadata/allow_list.yaml similarity index 100% rename from scripts/cli-migrations/v3/test/metadata/allow_list.yaml rename to packaging/cli-migrations/v3/test/metadata/allow_list.yaml diff --git a/scripts/cli-migrations/v3/test/metadata/cron_triggers.yaml b/packaging/cli-migrations/v3/test/metadata/cron_triggers.yaml similarity index 100% rename from scripts/cli-migrations/v3/test/metadata/cron_triggers.yaml rename to packaging/cli-migrations/v3/test/metadata/cron_triggers.yaml diff --git a/scripts/cli-migrations/v3/test/metadata/databases/databases.yaml b/packaging/cli-migrations/v3/test/metadata/databases/databases.yaml similarity index 100% rename from scripts/cli-migrations/v3/test/metadata/databases/databases.yaml rename to packaging/cli-migrations/v3/test/metadata/databases/databases.yaml diff --git a/scripts/cli-migrations/v3/test/metadata/databases/default/functions/functions.yaml b/packaging/cli-migrations/v3/test/metadata/databases/default/functions/functions.yaml similarity index 100% rename from scripts/cli-migrations/v3/test/metadata/databases/default/functions/functions.yaml rename to packaging/cli-migrations/v3/test/metadata/databases/default/functions/functions.yaml diff --git a/scripts/cli-migrations/v3/test/metadata/databases/default/tables/public_test.yaml b/packaging/cli-migrations/v3/test/metadata/databases/default/tables/public_test.yaml similarity index 100% rename from scripts/cli-migrations/v3/test/metadata/databases/default/tables/public_test.yaml rename to packaging/cli-migrations/v3/test/metadata/databases/default/tables/public_test.yaml diff --git a/scripts/cli-migrations/v3/test/metadata/databases/default/tables/tables.yaml b/packaging/cli-migrations/v3/test/metadata/databases/default/tables/tables.yaml similarity index 100% rename from scripts/cli-migrations/v3/test/metadata/databases/default/tables/tables.yaml rename to packaging/cli-migrations/v3/test/metadata/databases/default/tables/tables.yaml diff --git a/scripts/cli-migrations/v3/test/metadata/inherited_roles.yaml b/packaging/cli-migrations/v3/test/metadata/inherited_roles.yaml similarity index 100% rename from scripts/cli-migrations/v3/test/metadata/inherited_roles.yaml rename to packaging/cli-migrations/v3/test/metadata/inherited_roles.yaml diff --git a/scripts/cli-migrations/v3/test/metadata/query_collections.yaml b/packaging/cli-migrations/v3/test/metadata/query_collections.yaml similarity index 100% rename from scripts/cli-migrations/v3/test/metadata/query_collections.yaml rename to packaging/cli-migrations/v3/test/metadata/query_collections.yaml diff --git a/scripts/cli-migrations/v3/test/metadata/remote_schemas/remote_schemas.yaml b/packaging/cli-migrations/v3/test/metadata/remote_schemas/remote_schemas.yaml similarity index 100% rename from scripts/cli-migrations/v3/test/metadata/remote_schemas/remote_schemas.yaml rename to packaging/cli-migrations/v3/test/metadata/remote_schemas/remote_schemas.yaml diff --git a/scripts/cli-migrations/v3/test/metadata/rest_endpoints.yaml b/packaging/cli-migrations/v3/test/metadata/rest_endpoints.yaml similarity index 100% rename from scripts/cli-migrations/v3/test/metadata/rest_endpoints.yaml rename to packaging/cli-migrations/v3/test/metadata/rest_endpoints.yaml diff --git a/scripts/cli-migrations/v3/test/metadata/version.yaml b/packaging/cli-migrations/v3/test/metadata/version.yaml similarity index 100% rename from scripts/cli-migrations/v3/test/metadata/version.yaml rename to packaging/cli-migrations/v3/test/metadata/version.yaml diff --git a/scripts/cli-migrations/v3/test/migrations/default/1616826329751_create_table_public_test/down.sql b/packaging/cli-migrations/v3/test/migrations/default/1616826329751_create_table_public_test/down.sql similarity index 100% rename from scripts/cli-migrations/v3/test/migrations/default/1616826329751_create_table_public_test/down.sql rename to packaging/cli-migrations/v3/test/migrations/default/1616826329751_create_table_public_test/down.sql diff --git a/scripts/cli-migrations/v3/test/migrations/default/1616826329751_create_table_public_test/up.sql b/packaging/cli-migrations/v3/test/migrations/default/1616826329751_create_table_public_test/up.sql similarity index 100% rename from scripts/cli-migrations/v3/test/migrations/default/1616826329751_create_table_public_test/up.sql rename to packaging/cli-migrations/v3/test/migrations/default/1616826329751_create_table_public_test/up.sql diff --git a/scripts/cli-migrations/v3/test/test.sh b/packaging/cli-migrations/v3/test/test.sh similarity index 100% rename from scripts/cli-migrations/v3/test/test.sh rename to packaging/cli-migrations/v3/test/test.sh diff --git a/scripts/cli-migrations/v3/test/validation/catalog_cli_state.json b/packaging/cli-migrations/v3/test/validation/catalog_cli_state.json similarity index 100% rename from scripts/cli-migrations/v3/test/validation/catalog_cli_state.json rename to packaging/cli-migrations/v3/test/validation/catalog_cli_state.json diff --git a/scripts/cli-migrations/v3/test/validation/metadata.json b/packaging/cli-migrations/v3/test/validation/metadata.json similarity index 100% rename from scripts/cli-migrations/v3/test/validation/metadata.json rename to packaging/cli-migrations/v3/test/validation/metadata.json diff --git a/packaging/graphql-engine-base/centos.dockerfile b/packaging/graphql-engine-base/centos.dockerfile new file mode 100644 index 00000000000..432b7e38687 --- /dev/null +++ b/packaging/graphql-engine-base/centos.dockerfile @@ -0,0 +1,49 @@ +# DATE VERSION: 2022-03-10 +# Modify the above date version (YYYY-MM-DD) if you want to rebuild the image for security updates +FROM quay.io/centos/centos:stream8 + +# TARGETPLATFORM is automatically set up by docker buildx based on the platform we are targetting for +ARG TARGETPLATFORM + +RUN groupadd -g 1001 hasura && useradd -m -u 1001 -g hasura hasura + +# Dependencies taken from: https://github.com/0x777/hge-arm-dockerfiles/blob/master/hge.df +# Below are the CentOS libraries matching these apt/Debian ones: +# libpq5 libkrb5-3 libnuma1 ca-certificates (ca-certificates are preinstalled) +RUN yum update -y \ + && yum install -y dnf \ + && dnf upgrade \ + && dnf -qy module disable postgresql \ + && dnf install -y \ + krb5-libs \ + numactl-libs \ + libstdc++ \ + && case "$TARGETPLATFORM" in \ + "linux/amd64") \ + dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm \ + && dnf install -y postgresql13-devel \ + ;; \ + "linux/arm64") \ + dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-aarch64/pgdg-redhat-repo-latest.noarch.rpm \ + # TODO: remove --nogpgcheck after resolving https://www.postgresql.org/message-id/flat/CAA77xwWaf_ZhaTe6qS0O5vrJjx5pJs07GYipn7ZCbMrXfeVqTA%40mail.gmail.com + && dnf install -y --nogpgcheck postgresql13-devel \ + # TODO: remove following command after removing --nogpgcheck above + # The following file seem to cause installation issue with packages in the next steps + # Hence this file is removed here + && rm -rf /etc/yum.repos.d/pgdg-redhat-all.repo \ + ;; \ + esac + +# msodbcsql17 +RUN yum remove unixODBC-utf16 unixODBC-utf16-devel \ + && yum install -y unixODBC-devel \ + && if [ "$TARGETPLATFORM" = "linux/amd64" ] ; then \ + curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/mssql-release.repo \ + && ACCEPT_EULA=Y yum install -y msodbcsql17 ; \ + fi + +# mysql +RUN dnf install -y mariadb-connector-c pcre-devel \ + && ln -s /usr/lib64/libpcre.so /usr/lib64/libpcre.so.3 + +RUN yum clean all && rm -rf /var/cache/yum diff --git a/packaging/graphql-engine-base/debian.dockerfile b/packaging/graphql-engine-base/debian.dockerfile new file mode 100644 index 00000000000..3c8872f831d --- /dev/null +++ b/packaging/graphql-engine-base/debian.dockerfile @@ -0,0 +1,29 @@ +FROM debian:buster-20210511-slim + +# 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 + +RUN groupadd -g 1001 hasura && useradd -m -u 1001 -g hasura hasura + +RUN apt-get update \ + && apt-get install -y gnupg2 curl apt-transport-https \ + && apt-get update \ + && apt-get install -y ca-certificates libkrb5-3 libpq5 libnuma1 unixodbc-dev default-libmysqlclient-dev default-mysql-client + +RUN if [ "$TARGETPLATFORM" = "linux/amd64" ] ; then \ + curl -s https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list \ + && curl -s https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ + && apt-get update \ + && ACCEPT_EULA=Y apt-get install -y msodbcsql17 ; \ + fi + +# Cleanup unwanted files and packages +RUN apt-get -y remove curl gnupg2 \ + && apt-get -y auto-remove \ + && apt-get -y clean \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /usr/share/doc/ \ + && rm -rf /usr/share/man/ \ + && rm -rf /usr/share/locale/ \ No newline at end of file diff --git a/packaging/graphql-engine-base/ubuntu.dockerfile b/packaging/graphql-engine-base/ubuntu.dockerfile new file mode 100644 index 00000000000..958e72798df --- /dev/null +++ b/packaging/graphql-engine-base/ubuntu.dockerfile @@ -0,0 +1,29 @@ +FROM ubuntu:20.04 + +# 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 + +RUN groupadd -g 1001 hasura && useradd -m -u 1001 -g hasura hasura + +RUN apt-get update \ + && apt-get install -y gnupg2 curl apt-transport-https \ + && apt-get update \ + && apt-get install -y ca-certificates libkrb5-3 libpq5 libnuma1 unixodbc-dev libmariadb-dev-compat mariadb-client-10.3 + +RUN if [ "$TARGETPLATFORM" = "linux/amd64" ] ; then \ + curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ + && curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list > /etc/apt/sources.list.d/mssql-release.list \ + && apt-get update \ + && ACCEPT_EULA=Y apt-get install -y msodbcsql17 ; \ + fi + +# Cleanup unwanted files and packages +RUN apt-get -y remove curl gnupg2 \ + && apt-get -y auto-remove \ + && apt-get -y clean \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /usr/share/doc/ \ + && rm -rf /usr/share/man/ \ + && rm -rf /usr/share/locale/ \ No newline at end of file diff --git a/scripts/cli-migrations/v2/Dockerfile b/scripts/cli-migrations/v2/Dockerfile deleted file mode 100644 index fe4db1c4314..00000000000 --- a/scripts/cli-migrations/v2/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -ARG SERVER_IMAGE_TAG - -FROM hasura/graphql-engine:${SERVER_IMAGE_TAG} - -RUN apt-get update && apt-get install -y netcat - -# set an env var to let the cli know that -# update notification is disabled -ENV HASURA_GRAPHQL_SHOW_UPDATE_NOTIFICATION=false - -COPY docker-entrypoint.sh /bin/ -COPY hasura-cli /bin/hasura-cli - -RUN chmod +x /bin/hasura-cli - -# set an env var to let the cli know that -# it is running in server environment -ENV HASURA_GRAPHQL_CLI_ENVIRONMENT=server-on-docker - -ENTRYPOINT ["docker-entrypoint.sh"] - -CMD ["graphql-engine", "serve"] diff --git a/scripts/cli-migrations/v3/Dockerfile b/scripts/cli-migrations/v3/Dockerfile deleted file mode 100644 index d659a8960c9..00000000000 --- a/scripts/cli-migrations/v3/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -ARG SERVER_IMAGE_TAG - -FROM hasura/graphql-engine:${SERVER_IMAGE_TAG} - -RUN apt-get update && apt-get install -y netcat - -# set an env var to let the cli know that -# update notification is disabled -ENV HASURA_GRAPHQL_SHOW_UPDATE_NOTIFICATION=false - -COPY docker-entrypoint.sh /bin/ -COPY hasura-cli /bin/hasura-cli - -RUN chmod +x /bin/hasura-cli - -# set an env var to let the cli know that -# it is running in server environment -ENV HASURA_GRAPHQL_CLI_ENVIRONMENT=server-on-docker - -ENTRYPOINT ["docker-entrypoint.sh"] - -CMD ["graphql-engine", "serve"]