Skip to content

Commit df943d1

Browse files
committed
test: switch ampstart to gosu
1 parent ebe6872 commit df943d1

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

base/debian/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ LABEL org.opencontainers.image.licenses=MIT
88

99
ENV AMP_CONTAINER="DOCKER"
1010
ENV DEBIAN_FRONTEND="noninteractive"
11-
#ENV LD_LIBRARY_PATH="./:/opt/cubecoders/amp/:/AMP/"
1211

1312
ARG TARGETARCH
1413

@@ -18,7 +17,7 @@ RUN set -eux; \
1817
apt-get update; \
1918
apt-get install -o APT::Keep-Downloaded-Packages="false" -y \
2019
ca-certificates curl wget tar unzip xz-utils bzip2 \
21-
coreutils procps iproute2 iputils-ping socat jq git git-lfs gnupg tmux dbus \
20+
coreutils procps iproute2 iputils-ping socat jq git git-lfs gnupg tmux dbus gosu \
2221
tini tzdata locales \
2322
libssl3 libcurl4 libsqlite3-0 libzstd1 libsdl2-2.0-0 libsdl1.2-compat libfontconfig1 \
2423
# Required for Core Keeper

scripts/base/ampstart.sh

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/bin/bash
22

3-
#set -Eeuo pipefail
4-
#trap 'echo "[ERR] line $LINENO: $BASH_COMMAND (exit $?)"' ERR
3+
set -eo pipefail
54

65
echo "[Info] AMPStart for Docker"
76
ARCH=$(uname -m)
@@ -26,7 +25,7 @@ touch /home/amp/.gitconfig
2625
chown -R amp:amp /home/amp 2> /dev/null
2726

2827
# Make AMP binary executable
29-
AMP_BIN="/AMP/AMP_Linux_${ARCH}"
28+
export AMP_BIN="/AMP/AMP_Linux_${ARCH}"
3029
[ -f "${AMP_BIN}" ] && chmod +x "${AMP_BIN}"
3130

3231
# Install extra dependencies if needed
@@ -62,9 +61,7 @@ fi
6261

6362
# Handoff
6463
echo "[Info] Starting AMP..."
65-
exec su -l \
66-
-w AMPHOSTPLATFORM,AMP_CONTAINER,AMPMEMORYLIMIT,AMPSWAPLIMIT,AMPCONTAINERCPUS,AMP_CONTAINER_HOST_NETWORK,LANG,LANGUAGE,LC_ALL \
67-
amp -c '
68-
cd /AMP
69-
exec '"${AMP_BIN}"' "$@"
70-
' -- _ "$@"
64+
exec gosu amp:amp bash -lc '
65+
cd /AMP
66+
exec "${AMP_BIN}" "$@"
67+
' -- _ "$@"

0 commit comments

Comments
 (0)