• docker compose,link,Odoo


    1.报错:

    /usr/bin/docker-current: Error response from daemon: driver failed programming external connectivity on endpoint exchange2 (99119ad03c638e8d6282aa2480202dd3adfb9faeab6193f2d677d5363641a894): iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 32777 -j DNAT --to-destination 172.17.0.10:22 ! -i docker0: iptables: No chain/target/match by that name.

    处理:

    [root@node ~]# iptables -t nat -F
    [root@node ~]# systemctl stop docker
    [root@node ~]# iptables -t nat -F

    [root@node ~]# nmcli c down docker0

    Connection 'docker0' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/1)
    [root@node ~]# nmcli c up docker0
    Error: Connection 'docker0' does not exist.
    [root@node ~]# systemctl restart docker

    2.install compose:

    curl -L https://github.com/docker/compose/releases/download/1.14.0-rc2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
    chmod +x /usr/local/bin/docker-compose
    基本操作流程:

    1024 mkdir composetest
    1025 cd composetest
    1026 vi app.py

    [root@node composetest]# cat app.py
    from flask import Flask
    from redis import Redis

    app = Flask(__name__)
    redis = Redis(host='redis', port=6379)

    @app.route('/')
    def hello():
    count = redis.incr('hits')
    return 'Hello World! I have been seen {} times. '.format(count)

    if __name__ == "__main__":
    app.run(host="0.0.0.0", debug=True)
    [root@node composetest]#


    1027 vi requirements.txt

    [root@node composetest]# cat requirements.txt
    flask
    redis
    [root@node composetest]#


    1028 vi Dockerfile

    [root@node composetest]# cat Dockerfile
    FROM python:3.4-alpine
    ADD . /code
    WORKDIR /code
    RUN pip install -r requirements.txt
    CMD ["python", "app.py"]
    [root@node composetest]#


    1029 vi docker-compose.yml

    [root@node composetest]# cat docker-compose.yml
    version: '2'
    services:
    web:
    build: .
    ports:
    - "5000:5000"
    volumes:
    - .:/code
    redis:
    image: "redis:alpine"
    [root@node composetest]#


    1030 docker-compose up
    1031 docker image ls
    1032 docker images
    1033 docker-compose up -d
    1034 docker-compose ps

    [root@node composetest]# docker-compose ps
    Name Command State Ports
    -------------------------------------------------------------------------------------
    composetest_redis_1 docker-entrypoint.sh redis ... Up 6379/tcp
    composetest_web_1 python app.py Up 0.0.0.0:5000->5000/tcp
    [root@node composetest]#

    ok!!!

     6.installed odoo

    1043 docker create --name unkkuri-db-data library/postgres:9.4 /bin/true
    1044 docker run -d --name unkkuri-db --env POSTGRES_USER=odoo --env POSTGRES_PASSWORD=unkkuri-secret-pw --volumes-from unkkuri-db-data library/postgres:9.4
    1045 docker logs unkkuri-db
    1046 docker create -v /var/lib/odoo --name unkkuri-odoo-data odoo:10.0 /bin/true
    1047 docker run -d --name unkkuri-odoo --link unkkuri-db:db -p 8069:8069 --volumes-from unkkuri-odoo-data odoo:10.0 odoo --db_password=unkkuri-secret-pw
    1048 docker logs unkkuri-odoo

  • 相关阅读:
    最近积累的JS 东西,分享一下
    C#定时任务框架Quartz.NET
    如何成为微软社区MVP以及年终总结
    git 基于某个分支创建分支
    iframe跨域-Js通信的一种方式
    tcp连接建立断开过程及状态变化
    MySQL-InnoDB的事务隔离与锁
    MySQL索引原理总结
    php gd实现简单图片验证码与图片背景文字水印
    php 取post数据的三种方式
  • 原文地址:https://www.cnblogs.com/Jt00/p/7026415.html
Copyright © 2020-2023  润新知