思源笔记搭建

下载docker

在 CentOS 系统上安装 Docker,可以按照以下步骤进行:

  1. 卸载旧版 Docker(如果之前已经安装过):

    sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine
    
  2. 安装依赖工具:

    sudo yum install -y yum-utils \
      device-mapper-persistent-data \
      lvm2
    
  3. 添加 Docker 软件源:

    sudo yum-config-manager \
      --add-repo \
      https://download.docker.com/linux/centos/docker-ce.repo
    
  4. 安装 Docker:

    sudo yum install docker-ce docker-ce-cli containerd.io
    
  5. 启动 Docker 服务:

    sudo systemctl start docker
    
  6. 设置 Docker 开机自启:

    sudo systemctl enable docker
    
  7. 验证是否安装成功:

    sudo docker version
    

安装 Docker Compose

  1. 下载 Docker Compose 二进制文件:

    sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    

    如果安装不成功,手动执行

    echo $(uname -s)
    echo $(uname -m)
    

    拿到后,拼接成地址,然后下载后上传

    https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64
    

    本身是二进制文件,没有格式

    注意,是放到/usr/local/bin/里面,这个文件改名为docker-compose

  2. 添加可执行权限:

    sudo chmod +x /usr/local/bin/docker-compose
    
  3. 验证是否安装成功:

    docker-compose --version
    

    如果没有,需要添加环境变量

    /etc/profile
    添加 export PATH=$PATH:/usr/local/bin/
     source /etc/profile
    

下载和安装思源

https://gitee.com/siyuan-note/siyuan下载zip解压文件到/root/SiYuan中(是解压后的内容 而非一个文件夹)

chown -R 1000:1000 /opt/siyuan-v2.9.7/kernel

docker run -v /opt/siyuan-v2.9.7/kernel:/opt/siyuan-v2.9.7/kernel -p 6806:6806 b3log/siyuan --workspace=/opt/siyuan-v2.9.7/kernel

你可能感兴趣的:(笔记)