Skip to content

Commit

Permalink
feat: Add herd.1.1.27-debian-node.14.21/Dockerfile (#29)
Browse files Browse the repository at this point in the history
* feat: Add herd.1.1.27-debian-node.14.21/Dockerfile

* chore: Update docker file

* feat: Add more build platform support for node and herd images
  • Loading branch information
hustcer authored Oct 31, 2023
1 parent bbdfe20 commit 3aadac3
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ set -eo pipefail

image=registry.erda.cloud/erda-actions/terminus-debian-herd:1.1.18-n14.19

docker buildx build --platform linux/amd64 -t ${image} --push . -f Dockerfile
docker buildx build --platform linux/amd64,linux/arm64 -t ${image} --push . -f Dockerfile

echo "action meta: terminus-debian-herd-1.1.18-n14.19=$image"
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ set -eo pipefail

image=registry.erda.cloud/erda-actions/terminus-debian-herd:1.1.19-n16.16

docker buildx build --platform linux/amd64 -t ${image} --push . -f Dockerfile
docker buildx build --platform linux/amd64,linux/arm64 -t ${image} --push . -f Dockerfile

echo "action meta: terminus-debian-herd-1.1.19-n16.16=$image"
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ set -eo pipefail

image=registry.erda.cloud/erda-actions/terminus-debian-herd:1.1.20-n14.19

docker buildx build --platform linux/amd64 -t ${image} --push . -f Dockerfile
docker buildx build --platform linux/amd64,linux/arm64 -t ${image} --push . -f Dockerfile

echo "action meta: terminus-debian-herd-1.1.20-n14.19=$image"
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ set -eo pipefail

image=registry.erda.cloud/erda-actions/terminus-debian-herd:1.1.21-n14.19

docker buildx build --platform linux/amd64 -t ${image} --push . -f Dockerfile
docker buildx build --platform linux/amd64,linux/arm64 -t ${image} --push . -f Dockerfile

echo "action meta: terminus-debian-herd-1.1.21-n14.19=$image"
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ set -eo pipefail

image=registry.erda.cloud/erda-actions/terminus-debian-herd:1.1.25-n14.19

docker buildx build --platform linux/amd64 -t ${image} --push . -f Dockerfile
docker buildx build --platform linux/amd64,linux/arm64 -t ${image} --push . -f Dockerfile

echo "action meta: terminus-debian-herd-1.1.25-n14.19=$image"
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ set -eo pipefail

image=registry.erda.cloud/erda-actions/terminus-debian-herd:1.1.26-n14.19

docker buildx build --platform linux/amd64 -t ${image} --push . -f Dockerfile
docker buildx build --platform linux/amd64,linux/arm64 -t ${image} --push . -f Dockerfile

echo "action meta: terminus-debian-herd-1.1.26-n14.19=$image"
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ set -eo pipefail

image=registry.erda.cloud/erda-actions/terminus-debian-herd:1.1.26-n18.17

docker buildx build --platform linux/amd64 -t ${image} --push . -f Dockerfile
docker buildx build --platform linux/amd64,linux/arm64 -t ${image} --push . -f Dockerfile

echo "action meta: terminus-debian-herd-1.1.26-n18.17=$image"
78 changes: 78 additions & 0 deletions dockerfiles/terminus-herd/herd.1.1.27-debian-node.14.21/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Git: git version 2.30.2
# gcc version 10.2.1 20210110 (Debian 10.2.1-6)
# Node: 14.21.3 LTS, npm: 6.14.18, yarn: 1.22.19, herd: 1.1.27, pnpm: 7.33.6, fnm: 1.35.1
# /etc/os-release: Debian: Debian GNU/Linux 11 (bullseye)
# Kernel: Linux cd92393eb566 5.10.104-linuxkit Thu Mar 17 17:08:06 UTC 2022 x86_64 GNU/Linux
# Build cmd: docker build . -t terminus/debian-node.14-herd.1.1.27
# Other tags: terminus/debian-herd:1.1.27-n14.21,terminus/debian-herd:1.1.27
FROM node:14.21.3-bullseye-slim

LABEL maintainer=hustcer<[email protected]>

# Use mirrors to speed up installation
RUN cp /etc/apt/sources.list /etc/apt/sources.list.bak \
&& apt update \
&& apt upgrade -y \
&& apt install apt-transport-https ca-certificates locales -y --no-install-recommends --no-install-suggests \
&& echo 'deb https://mirrors.aliyun.com/debian/ bullseye main contrib non-free' > /etc/apt/sources.list \
&& echo 'deb https://mirrors.aliyun.com/debian/ bullseye-updates main contrib non-free' >> /etc/apt/sources.list \
&& echo 'deb https://mirrors.aliyun.com/debian/ bullseye-backports main contrib non-free' >> /etc/apt/sources.list \
&& echo 'deb https://mirrors.aliyun.com/debian-security bullseye-security main contrib non-free' >> /etc/apt/sources.list \
# Change locale & timezone
&& echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
&& echo "zh_CN.UTF-8 UTF-8" >> /etc/locale.gen \
&& locale-gen \
# Fix: copy and paste CJK characters in terminal.
&& echo 'set input-meta on' > /root/.inputrc \
&& echo 'set output-meta on' > /root/.inputrc \
&& echo 'set convert-meta off' > /root/.inputrc \
&& echo 'set enable-meta-key on' > /root/.inputrc \
&& echo "Asia/Shanghai" > /etc/timezone \
&& cp -a /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

ENV LANG=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV NODEJS_ORG_MIRROR="https://npmmirror.com/dist"
ENV SASS_BINARY_SITE="https://npmmirror.com/mirrors/node-sass"

RUN npm config set @terminus:registry https://registry.npm.terminus.io/ \
&& npm config set registry https://registry.npmmirror.com/ \
&& apt update \
&& apt install -y --no-install-recommends --no-install-suggests \
# Network related utils
wget curl telnet tcpdump net-tools dnsutils iputils-ping \
# Dev related
git gcc make g++ vim \
# SEE: https://github.com/BurntSushi/ripgrep
# SEE: https://github.com/sharkdp/fd#installation
tree fd-find ripgrep htop bzip2 unzip lsof procps \
# Make /bin/sh symlink to bash instead of dash:
&& echo "dash dash/sh boolean false" | debconf-set-selections \
&& DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash \
# fnm --- Reserved expansion point:
# See: https://github.com/Schniz/fnm, Fast and simple Node version manager
# Make it easier and faster to switch to other node versions in the future
# Just do: fnm install 16 && fnm use 16, will finish in 10 seconds.
&& curl -fsSL https://fnm.vercel.app/install | bash \
# Fix: fnm can't infer your shell based on the process tree.
&& sed -i 's/fnm env/fnm env --shell=bash/' /root/.bashrc \
# Setup root alias
&& echo "# Setup user alias" >> /root/.bashrc \
&& echo "alias ..='cd ..'" >> /root/.bashrc \
&& echo "alias fd='fdfind'" >> /root/.bashrc \
&& echo "alias ls='ls --color'" >> /root/.bashrc \
&& echo "alias ll='ls -l --color'" >> /root/.bashrc \
# Fix vim encoding for cjk characters
&& echo 'set enc=utf8' >> /etc/vim/vimrc \
&& echo 'set fencs=utf8,gbk,gb2312,gb18030' >> /etc/vim/vimrc \
# Add --unsafe-perm to fix 'Error: EACCES: permission denied, mkdir...' issue while install node-sass
&& npm i -g --unsafe-perm @terminus/[email protected] \
&& npm i -g pnpm@7 \
# Fix "Unable to find the global bin directory" error while running `pnpm i -g`
&& pnpm config set global-bin-dir '/usr/local/bin' \
&& rm -rf /var/lib/apt/lists/* && apt autoremove -y \
# Add dice and erda user and create home dir
&& useradd -m -s /bin/bash dice \
&& useradd -m -s /bin/bash erda

CMD [ "herd" ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -eo pipefail

image=registry.erda.cloud/erda-actions/terminus-debian-herd:1.1.27-n14.21

docker buildx build --platform linux/amd64,linux/arm64 -t ${image} --push . -f Dockerfile

echo "action meta: terminus-debian-herd-1.1.27-n14.21=$image"
2 changes: 1 addition & 1 deletion dockerfiles/terminus-nodejs/node.14.19.3/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ set -eo pipefail

image=registry.erda.cloud/erda-actions/terminus-debian-node:14.19-lts

docker buildx build --platform linux/amd64 -t ${image} --push . -f Dockerfile.debian.npm.6.14
docker buildx build --platform linux/amd64,linux/arm64 -t ${image} --push . -f Dockerfile.debian.npm.6.14

echo "action meta: terminus-debian-node=$image"
2 changes: 1 addition & 1 deletion dockerfiles/terminus-nodejs/node.16.16/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ set -eo pipefail

image=registry.erda.cloud/erda-actions/terminus-debian-node:16.16-lts

docker buildx build --platform linux/amd64 -t ${image} --push . -f Dockerfile.debian.npm.8.11
docker buildx build --platform linux/amd64,linux/arm64 -t ${image} --push . -f Dockerfile.debian.npm.8.11

echo "action meta: terminus-debian-node=$image"

0 comments on commit 3aadac3

Please sign in to comment.