在Ubuntu18.04或CentOS7上安装Shadow Daemon(ShadowD)并没有什么不同。

安装Docker和Docker-Compose

请参考我的帖子: 将Docker和Docker Compose安装到Ubuntu(16.04,18.04)和CentOS 7的最简单步骤


Ubuntu只需要发出三个命令:

apt-get更新

apt-get安装docker

apt-get安装docker-compose

对于CentOS,还有一个命令:

百胜安装码头工人

curl -L “//github.com/docker/compose/releases/download/1.25.4/ docker-compose-$(uname -s)-$(uname -m)” -o / usr / local / bin / docker-compose

chmod + x / usr / local / bin / docker-compose

ln -s / usr / local / bin / docker-compose / usr / bin / docker-compose

之后,您可以启动并启用docker服务,还可以验证docker和docker-compose版本:

systemctl启用docker

systemctl启动docker

码头工人–版本

docker-compose –verison

安装Git

对于Ubuntu,默认情况下已安装git。

对于CentOS,只有一个命令:

百胜安装git

[[email protected] ~]# 百胜安装git
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 0:1.8.3.1-21.el7_7 will be installed
--> Processing Dependency: perl-Git = 1.8.3.1-21.el7_7 for package: git-1.8.3.1-21.el7_7.x86_64
--> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.3.1-21.el7_7.x86_64
--> Processing Dependency: perl(Git) for package: git-1.8.3.1-21.el7_7.x86_64
--> Processing Dependency: perl(Error) for package: git-1.8.3.1-21.el7_7.x86_64
--> Running transaction check
---> Package perl-Error.noarch 1:0.17020-2.el7 will be installed
---> Package perl-Git.noarch 0:1.8.3.1-21.el7_7 will be installed
---> Package perl-TermReadKey.x86_64 0:2.30-20.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================================================================================================================================================================
 Package                                                               Arch                                                        Version                                                                 Repository                                                    Size
==============================================================================================================================================================================================================================================================================
Installing:
 git                                                                   x86_64                                                      1.8.3.1-21.el7_7                                                        updates                                                      4.4 M
Installing for dependencies:
 perl-Error                                                            noarch                                                      1:0.17020-2.el7                                                         base                                                          32 k
 perl-Git                                                              noarch                                                      1.8.3.1-21.el7_7                                                        updates                                                       55 k
 perl-TermReadKey                                                      x86_64                                                      2.30-20.el7                                                             base                                                          31 k

Transaction Summary
==============================================================================================================================================================================================================================================================================
Install  1 Package (+3 Dependent packages)

Total download size: 4.5 M
Installed size: 22 M
Is this ok [y/d/N]: y
Downloading packages:
(1/4): perl-TermReadKey-2.30-20.el7.x86_64.rpm                                                                                                                                                                                                         |  31 kB  00:00:00     
(2/4): perl-Error-0.17020-2.el7.noarch.rpm                                                                                                                                                                                                             |  32 kB  00:00:00     
(3/4): perl-Git-1.8.3.1-21.el7_7.noarch.rpm                                                                                                                                                                                                            |  55 kB  00:00:00     
(4/4): git-1.8.3.1-21.el7_7.x86_64.rpm                                                                                                                                                                                                                 | 4.4 MB  00:00:00     
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                                                         9.5 MB/s | 4.5 MB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:perl-Error-0.17020-2.el7.noarch                                                                                                                                                                                                                          1/4 
  Installing : perl-TermReadKey-2.30-20.el7.x86_64                                                                                                                                                                                                                        2/4 
  Installing : perl-Git-1.8.3.1-21.el7_7.noarch                                                                                                                                                                                                                           3/4 
  Installing : git-1.8.3.1-21.el7_7.x86_64                                                                                                                                                                                                                                4/4 
  Verifying  : git-1.8.3.1-21.el7_7.x86_64                                                                                                                                                                                                                                1/4 
  Verifying  : 1:perl-Error-0.17020-2.el7.noarch                                                                                                                                                                                                                          2/4 
  Verifying  : perl-Git-1.8.3.1-21.el7_7.noarch                                                                                                                                                                                                                           3/4 
  Verifying  : perl-TermReadKey-2.30-20.el7.x86_64                                                                                                                                                                                                                        4/4 

Installed:
  git.x86_64 0:1.8.3.1-21.el7_7                                                                                                                                                                                                                                               

Dependency Installed:
  perl-Error.noarch 1:0.17020-2.el7                                                       perl-Git.noarch 0:1.8.3.1-21.el7_7                                                       perl-TermReadKey.x86_64 0:2.30-20.el7                                                      

Complete!

安装Shadow Daemon

安装和启动Shadow Daemon的三个命令

git clone //github.com/zecure/packaging
cd packaging/docker/compose
sudo ./shadowdctl up -d
sudo ./shadowdctl exec web ./app/console swd:register --admin --name=netsec
[[email protected] ~]# ls
anaconda-ks.cfg  original-ks.cfg  packaging
[[email protected] ~]# cd packaging/
[[email protected] packaging]# ls
centos  debian  docker  gentoo  ubuntu
[[email protected] packaging]# cd docker/
[[email protected] docker]# ls
compose  shadowd  shadowd_database  shadowd_ui
[[email protected] docker]# cd compose
[[email protected] compose]# cat docker-compose.yml 
version: '3.1'
services:
  db:
    image: zecure/shadowd_database
    restart: always
    volumes:
      - "${SHADOWD_DB_LOCATION}:/var/lib/postgresql/data"
    env_file:
      - "${SHADOWD_ENV_DB_LOCATION}"

  web:
    image: zecure/shadowd_ui
    restart: always
    ports:
      - 8080:80
    links:
      - db
    depends_on:
      - db
    environment:
      - "SHADOWD_DB_HOST=db"
    env_file:
      - "${SHADOWD_ENV_DB_LOCATION}"

  shadowd:
    image: zecure/shadowd
    restart: always
    ports:
      - 9115:9115
    links:
      - db
    depends_on:
      - db
    environment:
      - "SHADOWD_DB_HOST=db"
    env_file:
      - "${SHADOWD_ENV_DB_LOCATION}"

[[email protected] compose]# 

通过 约翰扬

发表评论