Skip to content

Commit b3044f1

Browse files
authored
bump base image from 22.04 to 24.04 (#131)
* upgrade base eclipse-temurin image to ubuntu 24.04 noble * add BUILD_ARCHITECTURE build arg, default linux/amd64 * update ErrorFile path to /files for persistence; purge 90+ day old heap/error dirs
1 parent e132067 commit b3044f1

File tree

4 files changed

+28
-15
lines changed

4 files changed

+28
-15
lines changed

Dockerfile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# main eclipse-temurin jre, which is debian-based
22
ARG FROM_REPO_IMAGE=eclipse-temurin
3-
ARG FROM_TAG=17-jre-jammy
3+
ARG FROM_TAG=17-jre-noble
44

55
# uncomment for alpine-based eclipse-temurin jre
66
# ARG FROM_TAG=17-jre-alpine
@@ -151,22 +151,22 @@ RUN [ -n "${DEBUG}" ] && set -x; \
151151
apt-get update; \
152152
apt-get -yq --no-install-recommends install \
153153
openssl \
154-
gettext-base=0.21-4ubuntu4 \
155-
unzip=6.0-26ubuntu3.1 \
154+
gettext-base=0.21-14ubuntu2 \
155+
unzip=6.0-28ubuntu4.1 \
156156
; \
157157
if [ -n "${DEBUG}" ]; then \
158158
# next 2 lines are to get postgres15 to install on ubuntu 22.04
159159
echo "deb http://apt.postgresql.org/pub/repos/apt $(grep VERSION_CODENAME /etc/os-release | cut -d "=" -f2)-pgdg main" > /etc/apt/sources.list.d/pgdg.list; \
160160
wget -qO- https://www.postgresql.org/media/keys/ACCC4CF8.asc | tee /etc/apt/trusted.gpg.d/pgdg.asc > /dev/null 2>&1; \
161161
apt-get update; \
162162
apt-get -yq --no-install-recommends install \
163-
iputils-ping=3:20211215-1 \
164-
less=590-1ubuntu0.22.04.1 \
165-
netcat=1.218-4ubuntu1 \
166-
postgresql-client-15=15.5-1.pgdg22.04+1 \
167-
sudo=1.9.9-1ubuntu2.4 \
168-
tree=2.0.2-1 \
169-
vim=2:8.2.3995-1ubuntu2.13 \
163+
iputils-ping=3:20240117-1build1 \
164+
less=590-2ubuntu2.1 \
165+
netcat-traditional=1.10-48 \
166+
postgresql-client-16=16.6-0ubuntu0.24.04.1 \
167+
sudo=1.9.15p5-3ubuntu5 \
168+
tree=2.1.1-2ubuntu3 \
169+
vim=2:9.1.0016-1ubuntu7.5 \
170170
; \
171171
fi; \
172172
apt-get -yq upgrade; \

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ endif
88

99
DEBUG ?=
1010

11-
FROM_TAG ?= 17-jre-jammy
11+
FROM_TAG ?= 17-jre-noble
1212

1313
CACHE_FLAG ?= --no-cache
1414

@@ -25,9 +25,12 @@ LABKEY_VERSION ?= 21.5-SNAPSHOT
2525
LABKEY_DISTRIBUTION ?= community
2626
LABKEY_EK ?= 123abc456
2727

28+
BUILD_ARCHITECTURE ?= linux/amd64
29+
2830
# repo/image:tags must be lowercase
2931
BUILD_VERSION ?= $(shell echo '$(LABKEY_VERSION)' | tr A-Z a-z)
3032
BUILD_DISTRIBUTION := $(shell echo '$(LABKEY_DISTRIBUTION)' | tr A-Z a-z)
33+
BUILD_ARCHITECTURE ?= $(BUILD_ARCHITECTURE)
3134

3235
BUILD_REPO_URI ?= $(AWS_ACCOUNT_ID).dkr.ecr.$(AWS_REGION).amazonaws.com
3336
BUILD_REPO_NAME := labkey/$(BUILD_DISTRIBUTION)
@@ -57,6 +60,7 @@ build:
5760
docker build \
5861
--rm \
5962
--compress \
63+
--platform $(BUILD_ARCHITECTURE) \
6064
$(CACHE_FLAG) \
6165
-t $(BUILD_REPO_NAME):latest \
6266
-t $(BUILD_LOCAL_TAG) \

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ services:
421421
- JSON_OUTPUT=${JSON_OUTPUT-false}
422422
- DD_COLLECT_APM=${DD_COLLECT_APM-false}
423423
- SLEEP=${SLEEP:-0}
424+
- PURGE_HEAP_AND_ERROR_LOGS_OLDER_THAN_DAYS=${PURGE_HEAP_AND_ERROR_LOGS_OLDER_THAN_DAYS:-90}
424425

425426
pg-lims_starter:
426427
image: postgres:15

entrypoint.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ CSP_ENFORCE="${CSP_ENFORCE:-}"
2828
DD_COLLECT_APM="${DD_COLLECT_APM:-false}"
2929
JAVA_RMI_SERVER_HOSTNAME="${JAVA_RMI_SERVER_HOSTNAME:-}"
3030

31+
# set age past which old heap and error log directories are removed
32+
PURGE_HEAP_AND_ERROR_LOGS_OLDER_THAN_DAYS="${PURGE_HEAP_AND_ERROR_LOGS_OLDER_THAN_DAYS:-90}"
33+
3134
SLEEP="${SLEEP:=0}"
3235

3336
main() {
@@ -263,22 +266,27 @@ main() {
263266
unset LABKEY_CREATE_INITIAL_USER LABKEY_CREATE_INITIAL_USER_APIKEY LABKEY_INITIAL_USER_APIKEY LABKEY_INITIAL_USER_EMAIL LABKEY_INITIAL_USER_GROUP LABKEY_INITIAL_USER_ROLE
264267
unset LABKEY_EK SLEEP CONTAINER_PRIVATE_IP
265268

266-
HEAP_DUMP_PATH="$LABKEY_HOME/files/heap_dumps_$(date +%Y%m%d_%H%M%S)"
267-
mkdir -pv $HEAP_DUMP_PATH
269+
echo "Creating new heap/error log directory..."
270+
HEAP_AND_ERROR_PATH="$LABKEY_HOME/files/heap_dumps_and_errors_$(date +%Y%m%d_%H%M%S)"
271+
mkdir -pv $HEAP_AND_ERROR_PATH
272+
273+
# purge old heap/error directories
274+
echo "Purging heap/error log directories older than $PURGE_HEAP_AND_ERROR_LOGS_OLDER_THAN_DAYS days..."
275+
find "$LABKEY_HOME/files/" -mindepth 1 -maxdepth 1 -type d -ctime +${PURGE_HEAP_AND_ERROR_LOGS_OLDER_THAN_DAYS} -name "heap*" | xargs rm -rf
268276

269277
# shellcheck disable=SC2086
270278
exec java \
271279
\
272280
-Duser.timezone="${JAVA_TIMEZONE}" \
273281
\
274282
-XX:+HeapDumpOnOutOfMemoryError \
275-
-XX:HeapDumpPath="${HEAP_DUMP_PATH}" \
283+
-XX:HeapDumpPath="${HEAP_AND_ERROR_PATH}" \
276284
\
277285
-XX:MaxRAMPercentage="${MAX_JVM_RAM_PERCENT}" \
278286
\
279287
-XX:+UseContainerSupport \
280288
\
281-
-XX:ErrorFile="${LABKEY_HOME}/logs/error_%p.log" \
289+
-XX:ErrorFile="${HEAP_AND_ERROR_PATH}/error_%p.log" \
282290
\
283291
-Djava.net.preferIPv4Stack=true \
284292
\

0 commit comments

Comments
 (0)