-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add herd.1.1.27-debian-node.14.21/Dockerfile (#29)
* 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
Showing
11 changed files
with
95 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
dockerfiles/terminus-herd/herd.1.1.27-debian-node.14.21/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ] |
8 changes: 8 additions & 0 deletions
8
dockerfiles/terminus-herd/herd.1.1.27-debian-node.14.21/deploy.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters