一、制作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. JAVA中static什么作用?

    是静态修饰符,什么叫静态修饰符呢?大家都知道,在程序中任何变量或者代码都是在编译时由系统自动分配内存来存储的,而所谓静态就是指在编译后所分配的内存会一直存在,直到程序退出内存才会释放这个空间,也就是只 ...

  2. 12.2 linux下的线程

    什么是线程: 在一个程序里的一个执行路线就叫做线程(thread),更准确的定义是:线程是“一个进程内部的控制序列” 一切进程至少都有一个执行线程 进程与线程: 进程是资源竞争的基本单位 线程是程序执 ...

  3. int类型转string类型c++

    前言 使用VS的过程中,经常会用到需要将int类型数据转换为字符串类型,便于显示信息等. 实现方法 c++11标准中的to_string函数,在VS安装文件的include文件中生成的只读文件,使用起 ...

  4. [LeetCode&Python] Problem 876. Middle of the Linked List

    Given a non-empty, singly linked list with head node head, return a middle node of linked list. If t ...

  5. Tomcat问题:Neither the JAVA_HOME nor the JRE_HOME environment variable is defined ,At least one of these environment variable is needed to run this program

    一眼就能看出来是jdk的环境有问题,但是用了这么久的jdk一直都配置的好好的,怎么一到Tomcat上就这么矫情了. 最后查解决方案,原来是我的jdk从官网直接下载的,虽然我修改了java_home,但 ...

  6. null 与 undefinded

    null表示"没有对象",即该处不应该有值.典型用法是: (1) 作为函数的参数,表示该函数的参数不是对象. (2) 作为对象原型链的终点. Object.getPrototype ...

  7. 【BZOJ1703】【usaco2007margold】ranking the cows 奶牛的魅力排名

    想的时间比较长所以看题解了= = 原题: Fj有N(N<=1000)头牛,每头牛都有独一无二的正整数 魅力值,Fj想让他们按 魅力值排序. Fj已经知道M(1<=M<=10000)对 ...

  8. IntelliJ IDEA 2017激活

    最新更新: 在激活Jetbrains旗下任意产品的时候选择激活服务器 填入以下地址便可成功激活 http://idea.liyang.io 点击help→Register→License sever ...

  9. 【转】每天一个linux命令(21):find命令之xargs

    原文网址:http://www.cnblogs.com/peida/archive/2012/11/15/2770888.html 在使用 find命令的-exec选项处理匹配到的文件时, find命 ...

  10. hadoop之 exceeds the limit of concurrent xcievers处理

    dfs.datanode.max.transfer.threads: 默认 4096 < 2.0之前该参数为dfs.datanode.max.xcievers >解释:Specifies ...