Skip to content

Commit

Permalink
#27537 #27871 include in 23.10.24 LTS
Browse files Browse the repository at this point in the history
  • Loading branch information
erickgonzalez committed Jul 2, 2024
1 parent 5c19c3b commit 8b184bd
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 81 deletions.
31 changes: 12 additions & 19 deletions docker/java-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,9 @@ RUN apt update && \
apt upgrade -y && \
apt install -y --no-install-recommends zip unzip wget libtcnative-1 tzdata tini ca-certificates openssl libapr1 libpq-dev


# Install curl
RUN wget -O - https://repo.dotcms.com/artifactory/ext-release-local/com/dotcms/curl-static/curl-`uname -m` | install /dev/stdin /usr/bin/curl && \
chmod a+x /usr/bin/curl

# Downloading sdkman
#RUN curl -sL "https://get.sdkman.io" | bash

# Installing Java via sdkman
# Modules included
# java.naming - javax/naming/NamingException
# java.desktop - java/beans/PropertyEditorSupport
# java.management - javax/management/MBeanServer
# java.security.jgss - org/ietf/jgss/GSSException
# java.instrument - java/lang/instrument/IllegalClassFormatException
# jdk.unsupported - sun/misc/Unsafe, needed by caffine
# java.scripting - Nashhorn, needed by log4j
# java.rmi needed by Quartz
# jdk.compiler needed to build
# jdk.zipfs needed for gradle
chmod a+x /usr/bin/curl

RUN jlink \
--verbose \
Expand All @@ -45,7 +28,17 @@ RUN jlink \
--compress 2 \
--no-header-files \
--no-man-pages \
--output "$JAVA_OUTPUT_DIR"
--output "$JAVA_OUTPUT_DIR"

# install postgres clients, for pg_dump
ARG PG_BUILD_PACKAGES="postgresql-common gnupg"

RUN apt install -y --no-install-recommends $PG_BUILD_PACKAGES \
&& /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y \
&& apt install -y postgresql-client-16 \
&& apt purge -y $PG_BUILD_PACKAGES

RUN /usr/bin/pg_dump --version || exit 1

# Cleanup
RUN rm -rf /root/.sdkman && \
Expand Down
4 changes: 2 additions & 2 deletions docker/pg-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SHELL ["/bin/bash", "-c"]
ARG DEBIAN_FRONTEND=noninteractive

# see https://www.postgresql.org/ftp/source/ for versions
ARG POSTGRES_VERSION=15.3
ARG POSTGRES_VERSION=16.2

ARG POSTGRES_TARBALL=postgresql-${POSTGRES_VERSION}.tar.bz2
ARG FTP_PATH=https://ftp.postgresql.org/pub/source/v${POSTGRES_VERSION}
Expand All @@ -17,7 +17,7 @@ ARG BUILD_DEPS="build-essential ca-certificates curl zlib1g-dev"

# './configure --without-readline' currently means we won't have shared library
# dependencies that are not present in the dotcms image
ARG CONFIGURE_OPTS="--without-readline"
ARG CONFIGURE_OPTS="--without-readline --without-icu"

# builds client only - see https://www.postgresql.org/docs/current/install-procedure.html
RUN apt update -y \
Expand Down
4 changes: 3 additions & 1 deletion dotCMS/hotfix_tracking.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,6 @@ This maintenance release includes the following code fixes:
115. https://github.com/dotCMS/core/issues/23131 : Remove 10k Push Publishing Limit #23131
116. https://github.com/dotCMS/core/issues/28897 : Content Resource v1 hits the db #28897
117. https://github.com/dotCMS/core/issues/28890 : LanguageUtil.getLanguageId is always hitting the db #28890
118. https://github.com/dotCMS/core/issues/26421 : Block Editor: Add align-justify option to menu #26421
118. https://github.com/dotCMS/core/issues/26421 : Block Editor: Add align-justify option to menu #26421
119. https://github.com/dotCMS/core/issues/27537 : Download database not working in latest version #27537
120. https://github.com/dotCMS/core/issues/27871 : refactor pg_dump inclusion in our docker image #27871
75 changes: 17 additions & 58 deletions dotCMS/src/curl-test/Maintenance_Resource-Download_DB_Dump.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,21 @@
},
"item": [
{
"name": "exclude DB Dump",
"name": "Is pg_dump available",
"event": [
{
"listen": "test",
"script": {
"exec": [
"// ignore Download DB Dump collection",
"postman.setNextRequest(\"invalidateSession\")"
"pm.test(\"HTTP Status code must be 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"pm.test(\"The 'pg_dump' tool must be available\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData).to.eql(true, \"The 'pg_dump' tool is NOT available\");",
"});",
""
],
"type": "text/javascript"
}
Expand All @@ -38,14 +45,15 @@
"method": "GET",
"header": [],
"url": {
"raw": "{{serverURL}}/api/v1/logger",
"raw": "{{serverURL}}/api/v1/maintenance/_pgDumpAvailable",
"host": [
"{{serverURL}}"
],
"path": [
"api",
"v1",
"logger"
"maintenance",
"_pgDumpAvailable"
]
}
},
Expand All @@ -58,7 +66,7 @@
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code should be 200\", function () {",
"pm.test(\"HTTP Status code must be 200\", function () {",
" pm.response.to.have.status(200);",
"});",
""
Expand Down Expand Up @@ -100,63 +108,14 @@
},
"response": []
},
{
"name": "Is pg_dump available",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code should be 200\", function () {",
" pm.response.to.have.status(200);",
"});",
""
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "basic",
"basic": [
{
"key": "username",
"value": "[email protected]",
"type": "string"
},
{
"key": "password",
"value": "admin",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"url": {
"raw": "{{serverURL}}/api/v1/maintenance/_pgDumpAvailable",
"host": [
"{{serverURL}}"
],
"path": [
"api",
"v1",
"maintenance",
"_pgDumpAvailable"
]
}
},
"response": []
},
{
"name": "invalidateSession",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", function () {",
"pm.test(\"HTTP Status code must be 200\", function () {",
" pm.response.to.have.status(200);",
"});"
],
Expand Down Expand Up @@ -188,11 +147,11 @@
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code should be 401\", function () {",
"pm.test(\"HTTP Status code must be 401\", function () {",
" pm.response.to.have.status(401);",
"});",
"",
"pm.test(\"Valid response\", function () {",
"pm.test(\"Expected 'Invalid User' error must be present\", function () {",
" pm.expect(pm.response.text()).to.include(\"Invalid User\");",
"});",
""
Expand Down
15 changes: 14 additions & 1 deletion dotCMS/src/main/docker/original/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,24 @@ RUN find /srv/ -type f -name "*.sh" -exec chmod a+x {} \; && \
mkdir -p /data/local/dotsecure/license && \
chown -R $USER_NAME:$USER_NAME /data

# ----------------------------------------------
# Stage 3: Flatten everything to 1 layer
# ----------------------------------------------
FROM scratch

LABEL com.dotcms.contact "[email protected]"
LABEL com.dotcms.vendor "dotCMS LLC"
LABEL com.dotcms.description "dotCMS Content Management System"

ARG USER_UID="65001"
ARG USER_GID="65001"

COPY --from=container-base / /

# Switching to non-root user to install SDKMAN!
USER $USER_UID:$USER_GID
ENV JAVA_HOME="/java"
ENV PATH=$PATH:/java/bin:/usr/local/pgsql/bin
ENV PATH=$PATH:/java/bin

ENTRYPOINT ["/usr/bin/tini", "--", "/srv/entrypoint.sh"]
CMD ["dotcms"]
Expand Down

0 comments on commit 8b184bd

Please sign in to comment.