Files
my-dev-server/docker-entry-point.sh
2024-01-26 09:51:37 +00:00

24 lines
624 B
Bash
Executable File

#!/bin/bash
if [ -n "$ROOT_PASSWD" ]; then
echo "root:${ROOT_PASSWD}" | chpasswd
echo "密码设置完毕" >> /app/info.log
fi
if [ -n "$GIT_USER" ] && [ -n "$GIT_EMAIL" ]; then
touch /root/.gitconfig
git config --global user.name "$GIT_USER"
git config --global user.email "$GIT_EMAIL"
git config --global core.sshCommand "/usr/bin/ssh"
echo "git 用户已设置完毕" >> /app/info.log
fi
if [ -n "$DOCKER_USER" ] && [ -n "$DOCKER_PASSWD" ]; then
docker login -u "$DOCKER_USER" -p "$DOCKER_PASSWD"
echo "docker 用户登录完成" >> /app/info.log
fi
service ssh start >> /app/info.log
tail -f /app/info.log