Linux Mint 22 安装Docker和Odoo17 - xiaohao0576/odoo-doc GitHub Wiki

以下命令适用于 Ubuntu 24.04, Linux Mint 22

添加APT软件库

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu noble stable" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-get update

Install the Docker packages

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

验证安装是否成功 sudo docker run hello-world

安装后的设置

设置当前用户可以直接使用docker命令

sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker

设置docker开机自动启动

sudo systemctl enable docker.service
sudo systemctl enable containerd.service

以上步骤,docker安装成功,以下是通过Docker安装Odoo17

安装Odoo17

docker pull odoo:17.0
docker pull postgres:16

准备 docker-compose.yml文件

services:
  web:
    image: odoo:17.0
    restart: always
    depends_on:
      - db
    ports:
      - "8069:8069"
    volumes:
      - odoo-web-data:/var/lib/odoo
  db:
    image: postgres:16
    restart: always
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_USER=odoo
      - POSTGRES_PASSWORD=odoo
      - PGDATA=/var/lib/postgresql/data/pgdata
    volumes:
      - odoo-db-data:/var/lib/postgresql/data/pgdata
volumes:
  odoo-web-data:
  odoo-db-data:

启动Odoo17

docker-compose up -d

  • 停止odoo17,使用 docker-compose stop
  • 重启使用 docker-compose restart
  • 慎用 docker-compose down,因为这条命令会删除容器