Giter VIP home page Giter VIP logo

docker-orange's Introduction

Hi 👋, I'm Yufan

A passionate Java developer from China!

syhily

Connect with me:

syhilysyhilysyhilysyhilysyhily

Languages and Tools:

css3 docker elasticsearch git html5 java javascript jenkins kubernetes linux mongodb mysql nginx nodejs postgresql rabbitMQ react redis spring typescript vuejs


📝Weekly Development

syhily Wakatime Stats


🧐Contribution

syhily

syhily

syhily

docker-orange's People

Contributors

sumory avatar syhily avatar zorrofox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

docker-orange's Issues

无法开启 Dashboard 的访问认证

在 docker-entrypoint.sh 里增加了:

if [[ "X${ORANGE_AUTH}" != "X" ]]; then
sed -i "s/"auth": false/"auth": "${ORANGE_AUTH}"/g" ${ORANGE_CONF}
fi

并且 run 的时候增加参数

-e ORANGE_AUTH=true

但是认证并没有生效,还是可以直接访问到 Dashboard。

在容器内查看配置文件是启用了auth的。

Support docker-compose

Changes:

  • No need to manually import orange sql dump
  • Add a docker-compose.yml to simplify the usage.

Is there too many layers of creating docker?

Why not combained these commands into 1 or 2 ?
Even "nginx -V" RUN indepently...
If we combained and reduce neccessary cmds, it will reduce layers, and left more layers to users

1) Add User

2) Add configuration file & bootstrap file

3) Fix file permission

RUN
useradd www
&& echo "www:www" | chpasswd
&& echo "www ALL=(ALL) ALL" >> /etc/sudoers

RUN
mkdir -p ${ORANGE_PATH}/logs
&& chown -R www:www ${ORANGE_PATH}/*

Show installization info for debug

RUN
nginx -V

Set the default command to execute

when creating a new container

ADD docker-entrypoint.sh docker-entrypoint.sh
RUN
chmod 755 docker-entrypoint.sh
COPY docker-entrypoint.sh /usr/local/bin

尝试使用镜像在kubernetes里部署在控制面板上插件报错failed to enable plugin

查看日志
2018/05/03 11:21:28 [error] 40#40: *5 [lua] mysql_db.lua:30: query(): failed to connect: failed to connect: mysql could not be resolved (3: Host not found): nil nil, context: ngx.timer
2018/05/03 11:21:28 [error] 40#40: *5 [lua] dao.lua:386: init_selectors_of_plugin(): the size of selectors from storage is 0 when initializing plugin[divide] local selectors, context: ngx.timer
2018/05/03 11:21:28 [error] 40#40: *5 [lua] dao.lua:521: load data of plugin[divide] success, context: ngx.timer
2018/05/03 11:21:28 [error] 40#40: *5 [lua] mysql_db.lua:30: query(): failed to connect: failed to connect: mysql could not be resolved (3: Host not found): nil nil, context: ngx.timer
2018/05/03 11:21:28 [error] 40#40: *5 [lua] dao.lua:511: load data of plugin[kvstore] success, context: ngx.timer
请问这个是什么原因呢?
容器运行日志是没问题的

Check database connection
Connection closed by foreign host.
Connected
Database connected
[INFO] Orange: 0.6.4
[INFO] ngx_lua: 10008
[INFO] nginx: 1011002
[INFO] Lua: LuaJIT 2.1.0-beta2
[INFO] Orange store operation start:
[INFO] args:
[INFO] store_type:mysql
[INFO] port:3306
[INFO] host:10.97.167.48
[INFO] operation:init
[INFO] pwd:123456
[INFO] user:root
[INFO] db:orange
[INFO] file:/usr/local/orange/install/orange-v0.6.4.sql
[INFO] args end.
[INFO] Store init finished.

使用docker-compose 无法解析 db host

logs

2019/08/06 10:27:25 [error] 48#48: *11 [lua] mysql_db.lua:30: query(): failed to connect: failed to connect: orange-database could not be resolved (3: Host not found): nil nil, client: 192.168.48.1, server: , request: "POST /monitor/enable HTTP/1.1", host: "127.0.0.1:8889", referrer: "http://127.0.0.1:8889/monitor"
2019/08/06 10:27:25 [error] 48#48: *11 [lua] mysql_store.lua:91: update_enable(): MySQLStore:update error:nil, client: 192.168.48.1, server: , request: "POST /monitor/enable HTTP/1.1", host: "127.0.0.1:8889", referrer: "http://127.0.0.1:8889/monitor"
2019/08/06 10:27:27 [info] 49#49: *12 client closed connection while waiting for request, client: 192.168.48.1, server: 0.0.0.0:9999

进入容器能都ping telnet 也是ok的 容器的mysql 也是可以访问的

Dockerfile Build failed

Step 17 : RUN nginx -V && lord version
---> Running in e5a78b7bbcba
nginx version: openresty/1.11.2.1
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC)
built with OpenSSL 1.0.2j 26 Sep 2016
TLS SNI support enabled
configure arguments: --prefix=/usr/local/openresty/nginx --with-cc-opt=-O2 --add-module=../ngx_devel_kit-0.3.0 --add-module=../echo-nginx-module-0.60 --add-module=../xss-nginx-module-0.05 --add-module=../ngx_coolkit-0.2rc3 --add-module=../set-misc-nginx-module-0.31 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.06 --add-module=../srcache-nginx-module-0.31 --add-module=../ngx_lua-0.10.6 --add-module=../ngx_lua_upstream-0.06 --add-module=../headers-more-nginx-module-0.31 --add-module=../array-var-nginx-module-0.05 --add-module=../memc-nginx-module-0.17 --add-module=../redis2-nginx-module-0.13 --add-module=../redis-nginx-module-0.3.7 --add-module=../rds-json-nginx-module-0.14 --add-module=../rds-csv-nginx-module-0.07 --with-ld-opt=-Wl,-rpath,/usr/local/openresty/luajit/lib --with-openssl=/tmp/openssl-1.0.2j --with-pcre=/tmp/pcre-8.39 --with-file-aio --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_geoip_module=dynamic --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-http_xslt_module=dynamic --with-ipv6 --with-mail --with-mail_ssl_module --with-md5-asm --with-pcre-jit --with-sha1-asm --with-stream --with-stream_ssl_module --with-threads
/usr/bin/env: resty: No such file or directory
The command '/bin/sh -c nginx -V && lord version' returned a non-zero code: 127

使用docker-compose时,lua无法解析mysql-host

compose.yml内容如下:

version: '2'
services:
db:
    image: mysql
    expose:
      - "3306"
    environment:
      - MYSQL_ROOT_PASSWORD=docker
    privileged: true

gateway:
    image: syhily/docker-orange
    ports:
      - "27777:7777"
      - "28888:8888"
      - "29999:9999"
    security_opt:
      - seccomp:unconfined
    environment:
      - ORANGE_DATABASE=orange
      - ORANGE_HOST=orange-database
      - ORANGE_PORT=3306
      - ORANGE_USER=root
      - ORANGE_PWD=docker
    depends_on:
      - db
    links:
      - db:orange-database
    privileged: true

启动后,ping orange-database可以访问,但使用控制台操作数据库相关,报错[error] 26#26: *7 [lua] mysql_db.lua:30: query(): failed to connect: failed to connect: orange-database could not be resolved (3: Host not found): nil nil, client: 172.22.0.1, server: , request: "POST /redirect/enable HTTP/1.1", host: "127.0.0.1:29999", referrer: "http://127.0.0.1:29999/redirect"

这要怎么处理呢?使用docker run的命令是OK的。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.