首页 > 其他分享 >Jeecg安装记录(docker)

Jeecg安装记录(docker)

时间:2024-04-13 19:23:25浏览次数:13  
标签:sudo apt ubuntu docker 安装 Docker Jeecg

  1. Linux安装
    1.1 Linux安装

    1.2 SSH连接Linux
  • 使用xshell
  • 使用SSH
    • power shell连接Linux虚拟机_powershell连接虚拟机命令-CSDN博客
  1. 本地环境安装
  • java8
  • Maven
  • IDEA
  1. 虚拟机环境安装
    3.1 docker安装
    Ubuntu · Docker -- 从入门到实践
    卸载旧版本
    旧版本的 Docker 称为 docker 或者 docker-engine,使用以下命令卸载旧版本:
$ sudo apt-get remove docker \
               docker-engine \
               docker.io

使用 APT 安装
由于 apt 源使用 HTTPS 以确保软件下载过程中不被篡改。因此,我们首先需要添加使用 HTTPS 传输的软件包以及 CA 证书。

$ sudo apt-get update
$ sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg \
    lsb-release

鉴于国内网络问题,强烈建议使用国内源,官方源请在注释中查看。
为了确认所下载软件包的合法性,需要添加软件源的 GPG 密钥。
$ curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

官方源$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
然后,我们需要向 sources.list 中添加 Docker 软件源
$ echo \"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://mirrors.aliyun.com/docker-ce/linux/ubuntu \$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

官方源$ echo \"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
以上命令会添加稳定版本的 Docker APT 镜像源,如果需要测试版本的 Docker 请将 stable 改为 test。
安装 Docker
更新 apt 软件包缓存,并安装 docker-ce:

$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin

启动 Docker

$ sudo systemctl enable docker
$ sudo systemctl start docker

建立 docker 用户组
默认情况下,docker 命令会使用 Unix socket 与 Docker 引擎通讯。而只有 root 用户和 docker 组的用户才可以访问 Docker 引擎的 Unix socket。出于安全考虑,一般 Linux 系统上不会直接使用 root 用户。因此,更好地做法是将需要使用 docker 的用户加入 docker 用户组。
建立 docker 组:
$ sudo groupadd docker
将当前用户加入 docker 组:
$ sudo usermod -aG docker $USER
退出当前终端并重新登录,进行如下测试。
测试 Docker 是否安装正确

$ docker run --rm hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
b8dfde127a29: Pull complete
Digest: sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
The Docker client contacted the Docker daemon.
The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/
For more examples and ideas, visit:
 https://docs.docker.com/get-started/

若能正常输出以上信息,则说明安装成功。
3.2 MySQL安装与配置

- 拉取镜像
docker pull mysql:5.7
- 安装,此步注意需要设置MySQL大小写不敏感
# my_mysql 为自定义数据库名称
docker run --name my_mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root -d mysql:5.7 --lower_case_table_names=1
  • 连接navcat
    • 点击新建连接
    • 主机ip是虚拟机ip
    • 选择运行sql文件,选择jeecgboot的sql文件
      [图片]
      [图片]
      3.3 redis安装
  • 拉取镜像
    docker pull redis:latest
  • 安装
    $ docker run -itd --name my_redis -p 6379:6379 redis
  • 测试
    docker exec -it redis-test /bin/bash
    然后
    redis-cli
    出现
    127.0.0.1:6379>代表安装成功
  1. IDEA配置docker
    IDEA2023 配置使用Docker_SeanDe的博客-CSDN博客

  2. jeecg代码修改
    dev是开发环境
    prod是部署环境
    使用maven打包的时候,建议选择prod环境,并将application-prod.yml文件中的数据库地址密码和redis配置为虚拟机的地址

  3. docker命令记录

查看所有的容器命令如下:

$ docker ps -a

启动容器

以下命令使用 ubuntu 镜像启动一个容器,参数为以命令行模式进入该容器:

$ docker run -it ubuntu /bin/bash

使用 docker start 启动一个已停止的容器:

$ docker start b750bbbcfd88

后台运行

在大部分的场景下,我们希望 docker 的服务是在后台运行的,我们可以过 -d 指定容器的运行模式。
$ docker run -itd --name ubuntu-test ubuntu /bin/bash

停止一个容器,停止容器的命令如下:

$ docker stop <容器 ID>

停止的容器可以通过 docker restart 重启:

$ docker restart <容器 ID>

跟踪查看日志

docker logs -f -t 容器名称或者容器id

备注

  1. 飞书链接:链接:https://z6zsz5x2hd.feishu.cn/docx/PXNKdgYKxoDgTBxiiUQc4rcsnZd?from=from_copylink
  2. wsl上的docker,可能一开始没有办法直接访问项目地址,需要将端口映射出来

标签:sudo,apt,ubuntu,docker,安装,Docker,Jeecg
From: https://www.cnblogs.com/blanktao/p/18133236

相关文章

  • Docker+Net8运行https
    环境:win11,docker4.28.0,Net8。使用windows版docker 跑老外的run-aspnetcore-microservices 这个分布式项目时,最开始直接运行会遇到这个问题。中间也试了几种方法,有ok也有不行的,有些较为麻烦。Net8开始Docker 端口 默认端口8080了下面是我的1生成pfx文件d......
  • MySQL安装教程
    MySQL安装1.安装1).双击官方下来的安装包文件2).根据安装提示进行安装安装MySQL的相关组件,这个过程可能需要耗时几分钟,耐心等待。输入MySQL中root用户的密码,一定记得记住该密码2.配置安装好MySQL之后,还需要配置环境变量,这样才可以在任何目录下连接MySQL。......
  • 安装 pure-ftpd
    安装pure-ftpdyum安装yuminstall-yepel-releaseyuminstall-ypure-ftpd./configure--prefix=/usr/local/pure-ftpd/--with-everything‍touch/etc/pure-ftpd/pureftpd.pdbtouch/etc/pure-ftpd/pureftpd.passwdtouch/etc/ftpusers‍编译安装[root@VM-4-1......
  • 安装 MySQL 5.7
    安装MySQL5.7‍CentOS查看系统中是否自带安装MySQL[root@localhost~]#yumlistinstalled|grepmysql[root@localhost~]#[root@node01~]#yumlistinstalled|grepmysqlmysql-libs.x86_645.1.71-1.el6@anaconda-CentOS-201311272149.x86_64/6.5[r......
  • centos6.5安装python3.6.9
    下载python:https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz安装tar-zxvfPython-3.6.9.tgzcdPython-3.6.9./configure--prefix=/opt/python3.6makemakeinstallecho"/opt/python3.6/lib">/etc/ld.so.conf.d/python3.6.9.confsudoldconf......
  • Linux下使用docker部署mysql(一)
    1.拉取dockerdockerpullmysql:5.7 2.配置挂载目录sudomkdir-p/docker_data/mysql/datasudomkdir-p/docker_data/mysql/confsudomkdir-p/docker_data/mysql/conf/conf.dsudomkdir-p/docker_data/mysql/conf/mysql.conf.dsudomkdir-p/docker_data/mysql/logs......
  • 通过 aqtinstall 安装 Qt5 的库
    QtMaintenanceTool(QtOnlineInstaller)可能没有Qt5的安装选项了,但是从Qt官网下载的qt-opensource-windows-x86-5.14.2.exe安装器在安装的时候会安装旧的QtCreator。如果你不想要旧的QtCreator并且需要的版本不是Qt5.14.2,安装起来可能不是很方便。有一个命令行工具可......
  • PP-HumanSeg安装、运行、训练、测试
    参考paddleseg官网https://aistudio.baidu.com/projectdetail/2189481?channelType=0&channel=0零、准备工作1.用conda创建虚拟环境#1.查询conda环境下有哪些虚拟环境condainfo--envs#2.创建指定python版本的环境condacreate-nPaddleSeg_py_38python=3.8#3.......
  • Ubuntu18.04安装opensips一次过,实现sip语音视频通话
    安装方式apt命令安装,不建议使用此方式想要在ubuntu18.04(建议使用18.04,不出错)上通过apt命令安装的可以借鉴一下这篇文章,但是这篇文章中博主有错误并未解决,下面是解决方式执行下列命令,使用opensipsdbctl创建数据库的时候会报错opensipsdbctlcreate#错误信息为ERROR:......
  • docker 报错:不能选择设备驱动 could not select device driver 的解决方法(实测有效)
    Ubuntu安装完docker引擎后,在创建容器的时候指定 --gpusall,出现报错如下:报错: docker:Errorresponsefromdaemon:couldnotselectdevicedriver""withcapabilities:[[gpu]].解决该问题还需要安装Nvidia-docker,本篇参照Nvidia官网。NVIDIAContainerToolkit在许多......