一、制作alpine版的kong镜像

https://github.com/Kong/docker-kong/tree/d4cec3dc46c780a916a40963309554ca81da2b46/alpine

需要修改Dockerfile,增加执行权限,否则会报错:

Error response from daemon: invalid header field value "oci runtime error: container_linux.go:247: starting container process caused \"exec: \\\"/docker-entrypoint.sh\\\": permission denied\"\n".

修改后Dockerfile为:

FROM alpine:3.6
LABEL maintainer Marco Palladino, marco@mashape.com ENV KONG_VERSION 0.12.1
ENV KONG_SHA256 9f699e20e7d3aa6906b14d6b52cae9996995d595d646f9b10ce09c61d91a4257 RUN apk add --no-cache --virtual .build-deps wget tar ca-certificates \
&& apk add --no-cache libgcc openssl pcre perl tzdata \
&& wget -O kong.tar.gz "https://bintray.com/kong/kong-community-edition-alpine-tar/download_file?file_path=kong-community-edition-$KONG_VERSION.apk.tar.gz" \
&& echo "$KONG_SHA256 *kong.tar.gz" | sha256sum -c - \
&& tar -xzf kong.tar.gz -C /tmp \
&& rm -f kong.tar.gz \
&& cp -R /tmp/usr / \
&& rm -rf /tmp/usr \
&& cp -R /tmp/etc / \
&& rm -rf /tmp/etc \
&& apk del .build-deps COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"] EXPOSE 8000 8443 8001 8444 STOPSIGNAL SIGTERM CMD ["/usr/local/openresty/nginx/sbin/nginx", "-c", "/usr/local/kong/nginx.conf", "-p", "/usr/local/kong/"]
~

二、Tag后push到私有镜像仓库

docker tag  kong:0.12.1-alpine xx.xx.xx.xx:5000/kong:0.12.1-alpine
docker push xx.xx.xx.xx:5000/kong:0.12.1-alpine

三、准备,并运行kong,

可参考:https://getkong.org/install/docker/?_ga=2.142464946.1094900129.1519568988-2071034501.1509695831

先运行postgres数据库

docker run -d --name kong-database \
-p 5432:5432 \
-e "POSTGRES_USER=kong" \
-e "POSTGRES_DB=kong" \
postgres:9.4

迁移数据

docker run --rm \
--link kong-database:kong-database \
-e "KONG_DATABASE=postgres" \
-e "KONG_PG_HOST=kong-database" \
-e "KONG_CASSANDRA_CONTACT_POINTS=kong-database" \
kong:0.12.1-alpine kong migrations up

运行Kong

docker run -d --name kong \
--link kong-database:kong-database \
-e "KONG_PG_HOST=kong-database" \
-e "KONG_PROXY_ACCESS_LOG=/dev/stdout" \
-e "KONG_ADMIN_ACCESS_LOG=/dev/stdout" \
-e "KONG_PROXY_ERROR_LOG=/dev/stderr" \
-e "KONG_ADMIN_ERROR_LOG=/dev/stderr" \
-e "KONG_ADMIN_LISTEN=0.0.0.0:8001" \
-e "KONG_ADMIN_LISTEN_SSL=0.0.0.0:8444" \
-p 8000:8000 \
-p 8443:8443 \
-p 8001:8001 \
-p 8444:8444 \
Kong:0.12.1-alpine

运行kong dashboard

参考:https://github.com/PGBI/kong-dashboard

docker run --name kong-dashboard -d -p 8084:8080 pgbi/kong-dashboard:v2

在docker中运行kong和kong dashboard的更多相关文章

  1. 在docker中运行ASP.NET Core Web API应用程序

    本文是一篇指导快速演练的文章,将介绍在docker中运行一个ASP.NET Core Web API应用程序的基本步骤,在介绍的过程中,也会对docker的使用进行一些简单的描述.对于.NET Cor ...

  2. .NET Core Web 应用部署到 Docker 中运行

    环境介绍 : 虚拟机:VirtualBox 5.1.6 系 统:Ubuntu 16.04.1 LTS 系统准备完成后可以使用 sudo apt-get udpate 和 sudo apt-get up ...

  3. docker中运行ASP.NET Core Web API

    在docker中运行ASP.NET Core Web API应用程序 本文是一篇指导快速演练的文章,将介绍在docker中运行一个ASP.NET Core Web API应用程序的基本步骤,在介绍的过 ...

  4. 在Docker中运行torch版的neural style

    相关的代码都在Github上,请参见我的Github,https://github.com/lijingpeng/deep-learning-notes 敬请多多关注哈~~~ 在Docker中运行to ...

  5. ASP.NET Core 网站在Docker中运行

    Docker作为新一代的虚拟化方式,未来肯定会得到广泛的应用,传统虚拟机的部署方式要保证开发环境.测试环境.UAT环境.生产环境的依赖一致性,需要大量的运维人力,使用Docker我们可以实现一次部署, ...

  6. 在Docker中运行EOS(MAC版)

    在Docker中运行EOS(MAC版) 在Docker中也可以简单快速的构建EOS.IO.笔者在Mac平台下参考官方文档躺了一次河.记录如下: 安装依赖 Docker 版本 17.05或者更高 tes ...

  7. 在docker中运行jenkins实现代码自动发布到测试服务器

    在docker中运行jenkins 用的镜像是apline版:lts-alpine,并设置正确的时区. docker run --name jenkins_master -d \ -p 8081:80 ...

  8. 在Docker中运行纸壳CMS并配置使用MySql

    纸壳CMS是基于ASP.Net Core开发的可视化内容管理系统,可以跨平台部署,可以在容器中运行.接下来看看如何在docker中运行纸壳CMS. GitHub:https://github.com/ ...

  9. 在docker中运行elasticsearch时go程序无法连接到节点

    错误信息: panic: no active connection found: no Elasticsearch node available 在docker中运行es时,默认启动sniffing  ...

  10. 记一个在docker中运行多线程event_loop.run_forever()的bug

    问题简介 我写爬虫,用到了asyncio相关的事件循环,新建了一个线程去run_forever(),在docker中运行.后来程序有异常,主线程挂了,但是竟然不报错.查了很久,才找出来. 如果你新建一 ...

随机推荐

  1. HAL_RTC_MspInit Msp指代什么?

    /********************************************************************************* * HAL_RTC_MspInit ...

  2. zoj 1108 FatMouse's Speed 基础dp

    FatMouse's Speed Time Limit: 2 Seconds      Memory Limit:65536 KB     Special Judge FatMouse believe ...

  3. BZOJ4836: [Lydsy1704月赛]二元运算【分治FFT】【卡常(没卡过)】

    Description 定义二元运算 opt 满足 现在给定一个长为 n 的数列 a 和一个长为 m 的数列 b ,接下来有 q 次询问.每次询问给定一个数字 c 你需要求出有多少对 (i, j) 使 ...

  4. HUD 1969:Pie(二分)

    Pie Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submis ...

  5. Maze dfs倒行

    Pavel loves grid mazes. A grid maze is an n × m rectangle maze where each cell is either empty, or i ...

  6. BZOJ2460,LG4570 [BJWC2011]元素

    题意 相传,在远古时期,位于西方大陆的 Magic Land 上,人们已经掌握了用魔法矿石炼制法杖的技术.那时人们就认识到,一个法杖的法力取决于使用的矿石. 一般地,矿石越多则法力越强,但物极必反:有 ...

  7. ehci及其伴随ohci主机控制器驱动分析

    1. 正常插入 插上U盘产生中断调用usb_hcd_irq: usb_hcd_irq ehci_irq usb_hcd_resume_root_hub queue_work(pm_wq, &h ...

  8. git代码回退

    情况1.还没有push可能 git add ,commit以后发现代码有点问题,想取消提交,用: reset git reset [--soft | --mixed | --hard] eg:  gi ...

  9. flash TweenMax用法

    二,TweenMax主类: 这里分几个大块来介绍,分别是:第三个参数特有属性(29个),PlugIn(17个),公共属性(10个),公共方法(20个). 1,第三个参数特有属性(29个): 这29个参 ...

  10. 标 题: Re: 总感觉IT没我大山东啥事?

    发信人: liuzhlai (liuzhlai), 信区: ITExpress 标  题: Re: 总感觉IT没我大山东啥事? 发信站: 水木社区 (Sat Aug 22 15:51:50 2015) ...