开发容器启动配置
This commit is contained in:
36
once-init.sh
Normal file
36
once-init.sh
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
set -eux
|
||||
|
||||
# use VNC DISPLAY by default
|
||||
echo "export DISPLAY=:1.0" >> /etc/profile.d/00-restore-env.sh
|
||||
|
||||
mkdir -pv /home/codespace/.cargo
|
||||
cat > /home/codespace/.cargo/config.toml << EOF
|
||||
[source.crates-io]
|
||||
replace-with = 'aliyun'
|
||||
|
||||
[source.mirror]
|
||||
registry = "sparse+https://mirrors.tuna.tsinghua.edu.cn/crates.io-index/"
|
||||
|
||||
[source.aliyun]
|
||||
registry = "sparse+https://mirrors.aliyun.com/crates.io-index/"
|
||||
|
||||
#[registries.mirror]
|
||||
#index = "sparse+https://mirrors.tuna.tsinghua.edu.cn/crates.io-index/"
|
||||
EOF
|
||||
|
||||
# fix permissions
|
||||
chown -R codespace:codespace /workspace
|
||||
chown -R codespace:codespace /home/codespace/
|
||||
chmod 700 /home/codespace/.ssh
|
||||
chmod 600 /home/codespace/.ssh/authorized_keys
|
||||
|
||||
# configuration
|
||||
sudo -u codespace git config --global user.email "me@yqxpro.com"
|
||||
sudo -u codespace git config --global user.name "QXYang686"
|
||||
|
||||
sudo -u codespace npm config set registry https://registry.npmmirror.com
|
||||
|
||||
|
||||
|
||||
sudo -u codespace ln -snf /workspace/dev-server /home/codespace/Projects
|
||||
Reference in New Issue
Block a user