-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathContainerfile
More file actions
53 lines (47 loc) · 1.77 KB
/
Copy pathContainerfile
File metadata and controls
53 lines (47 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM debian:trixie-slim
ARG DEBIAN_FRONTEND=noninteractive
ARG TARGETARCH
ENV PORT=3000
EXPOSE ${PORT}/tcp
# install necessary dependencies
RUN <<EOT
set -eux
apt-get update && apt-get install -y curl unzip jq iproute2
rm -rf /var/lib/apt/lists/*
EOT
# download and unpack the latest Peacock (Linux) release
RUN <<EOT
set -eux
LATEST_RELEASE=$(curl -fsSL --compressed -H 'Accept: application/json' 'https://api.github.com/repos/thepeacockproject/Peacock/releases/latest' | jq -r .tag_name)
FOLDER_NAME="Peacock-${LATEST_RELEASE}-linux"
FILE_NAME="${FOLDER_NAME}.zip"
curl -fsSLJO -H 'Accept: application/octet-stream' "https://github.com/thepeacockproject/Peacock/releases/latest/download/${FILE_NAME}"
unzip -q "$FILE_NAME" -x '*/PeacockPatcher.exe'
rm "$FILE_NAME"
mv "$FOLDER_NAME" /peacock
mkdir /peacock/options
mv /peacock/options.ini /peacock/options/options.ini
ln -s /peacock/options/options.ini /peacock/options.ini
OFFLINE_ASSETS=ImagePack.zip
curl -fsSLJO -H 'Accept: application/octet-stream' "https://github.com/thepeacockproject/ImagePack/releases/latest/download/${OFFLINE_ASSETS}"
unzip -q $OFFLINE_ASSETS -x LICENSE README.md _redirects -d /peacock
rm $OFFLINE_ASSETS
EOT
# install node
RUN <<EOT
set -eux
NODE_VERSION=$(cat peacock/.nvmrc)
NODE_DIR=/usr/local
case "$TARGETARCH" in
amd64) NODE_ARCH='x64' OPENSSL_ARCH='linux-x86_64';;
arm64) NODE_ARCH='arm64' OPENSSL_ARCH='linux-aarch64';;
esac
NODE_URL="https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-linux-${NODE_ARCH}.tar.gz"
curl -f#L "$NODE_URL" | tar -xz --strip-components=1 --no-same-owner -C $NODE_DIR -f -
find "${NODE_DIR}/include/node/openssl/archs" -mindepth 1 -maxdepth 1 ! -name "$OPENSSL_ARCH" -exec rm -rf {} +
node --version
EOT
WORKDIR /peacock
ENTRYPOINT ["node"]
# run Peacock
CMD ["chunk0.js"]