fixed rust image

This commit is contained in:
gOOvER
2025-01-15 10:09:04 +01:00
parent 5c01dfcce1
commit f6d97cee25
2 changed files with 55 additions and 25 deletions

View File

@@ -1,21 +1,41 @@
FROM --platform=$TARGETOS/$TARGETARCH node:18-slim
FROM node:22-slim
ENV DEBIAN_FRONTEND=noninteractive
ARG DEBIAN_FRONTEND=noninteractive
RUN dpkg --add-architecture i386 \
&& apt update \
&& apt upgrade -y \
&& apt install -y lib32gcc-s1 lib32stdc++6 unzip curl iproute2 tzdata libgdiplus libsdl2-2.0-0:i386 \
&& mkdir /wrapper \
&& npm install --prefix /wrapper ws \
&& useradd -d /home/container -m container
&& apt upgrade -y
RUN apt install -y \
lib32gcc-s1 \
lib32stdc++6 \
locales \
unzip \
curl \
iproute2 \
tzdata \
libgdiplus \
libsdl2-2.0-0:i386
RUN mkdir /wrapper \
&& npm install --prefix /wrapper ws
# Set the locale
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
locale-gen
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8
## Setup user and working directory
RUN useradd -m -d /home/container -s /bin/bash container
USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container
COPY ./entrypoint.sh /entrypoint.sh
COPY ./wrapper.js /wrapper/wrapper.js
COPY --chown=container:container ./wrapper.js /wrapper/wrapper.js
RUN chmod +x /wrapper/wrapper.js
CMD [ "/bin/bash", "/entrypoint.sh" ]

View File

@@ -1,8 +1,18 @@
#!/bin/bash
cd /home/container
# Make internal Docker IP address available to processes.
export INTERNAL_IP=`ip route get 1 | awk '{print $(NF-2);exit}'`
# Wait for the container to fully initialize
sleep 1
# Default the TZ environment variable to UTC.
TZ=${TZ:-UTC}
export TZ
# Set environment variable that holds the Internal Docker IP
INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}')
export INTERNAL_IP
# Switch to the container's working directory
cd /home/container || exit 1
## if auto_update is not set or to 1 update
if [ -z ${AUTO_UPDATE} ] || [ "${AUTO_UPDATE}" == "1" ]; then
@@ -13,7 +23,7 @@ else
fi
# Replace Startup Variables
MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')`
MODIFIED_STARTUP=$(eval echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')
echo ":/home/container$ ${MODIFIED_STARTUP}"
if [[ "${FRAMEWORK}" == "carbon" ]]; then