docker server 操作日志
安装软件
1 2
| yum install epel-release -y yum install dnf -y
|
1
| dnf install -y bash-completion bash-completion-extras
|
1 2
| wget https://centos7.iuscommunity.org/ius-release.rpm dnf install -y ius-release*.rpm
|
1 2
| dnf install -y zsh sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
|
编辑 .zshrc 启用 git, docker, docker-compose 插件
/etc/hosts
文件设置
1
| 54.231.49.3 s3.amazonaws.com
|
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
| yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo dnf install -y docker-ce systemctl start docker systemctl enable docker yum-config-manager --disable docker-ce curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s https://registry.docker-cn.com systemctl restart docker curl -L https://github.com/docker/compose/releases/download/1.14.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose cat > /usr/local/bin/dc <<EOF #!/bin/bash /usr/local/bin/docker-compose -p=${PWD//\//_} $@ EOF chmod +x /usr/local/bin/dc
|
1 2
| wget https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz tar -C /usr/local -xzf go1.8.3.linux-amd64.tar.gz
|
1 2 3 4 5 6 7 8
| curl -sL https://rpm.nodesource.com/setup_8.x | bash - dnf install -y nodejs yum-config-manager --disable nodesource wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo dnf install -y yarn yum-config-manager --disable yarn
|
1 2
| dnf install -y php71u-cli php71u-pdo php71u-json php71u-soap php71u-bcmath php71u-mysqlnd php71u-opcache php71u-mbstring php71u-pecl-memcached php71u-pecl-redis php71u-gd php71u-intl dnf install -y composer
|
1 2
| dnf install -y python36u ln -s /usr/bin/python3.6 /usr/bin/python3
|
1 2 3 4
| dnf install -y httpd-tools dnf install -y the_silver_searcher dnf install -y enca dnf install -y tree
|
打开 ~/.zshrc,加入如下内容:
1 2 3 4 5 6 7
| alias sc="/usr/bin/systemctl" alias g="/usr/bin/git" alias gpl="/usr/bin/git pull --rebase" alias gcd="/usr/bin/git checkout dev" alias gw="/usr/bin/git whatchanged" alias d="/usr/bin/docker" alias dkc="/usr/bin/docker-compose"
|
/etc/hosts
文件设置
1
| 219.76.4.4 github-cloud.s3.amazonaws.com
|
- 共享 composer, yarn 的 cache 目录
新建文件/etc/profile.d/cache-dir.sh
,内容如下:
1 2 3 4 5
| COMPOSER_CACHE_DIR=/home/shares/composer/cache YARN_CACHE_FOLDER=/home/shares/yarn/cache export COMPOSER_CACHE_DIR export YARN_CACHE_FOLDER
|
1 2
| curl -L http://cs.sensiolabs.org/download/php-cs-fixer-v2.phar -o /usr/local/bin/php-cs-fixer chmod +x /usr/local/bin/php-cs-fixer
|