参考github上的dockerfile https://github.com/Kong/docker-kong/tree/master/centos ,在dockefile里面添加自定义的内容进行进行编译。本例中在官方的例子上安装了telnet、iproutes等软件包,同时为了实现网关的后续的应用程序认证鉴权,增加了graphql的lua扩展模块

准备dockerfile

FROM centos:7LABEL maintainer="Kong <support@konghq.com>"ARG ASSET=ceENV ASSET $ASSETARG EE_PORTSCOPY kong.rpm /tmp/kong.rpmARG KONG_VERSION=2.3.2ENV KONG_VERSION $KONG_VERSIONARG KONG_SHA256="aad05b5b7425a0c1dc3095363c785a4147d3cd91064f0221a2a818c7bdcc97dc"RUN set -ex; \  if [ "$ASSET" = "ce" ] ; then \    curl -fL "https://bintray.com/kong/kong-rpm/download_file?file_path=centos/7/kong-$KONG_VERSION.el7.amd64.rpm" -o /tmp/kong.rpm \    && echo "$KONG_SHA256 /tmp/kong.rpm" | sha256sum -c -; \  fi; \  yum install -y -q unzip shadow-utils git net-tools iproute langpacks-zh_CN telnet lrzsz \  && yum clean all -q \  && rm -fr /var/cache/yum/* /tmp/yum_save*.yumtx /root/.pki \  # Please update the centos install docs if the below line is changed so that  # end users can properly install Kong along with its required dependencies  # and that our CI does not diverge from our docs.  && yum install -y /tmp/kong.rpm \  && yum clean all \  && rm /tmp/kong.rpm \  && chown kong:0 /usr/local/bin/kong \  && chown -R kong:0 /usr/local/kong \  && luarocks install graphql && \    if [ "$ASSET" = "ce" ] ; then \    kong version ; \  fi;COPY docker-entrypoint.sh /docker-entrypoint.shUSER kongENTRYPOINT ["/docker-entrypoint.sh"]EXPOSE 8000 8443 8001 8444 $EE_PORTSSTOPSIGNAL SIGQUITCMD ["kong", "docker-start"]

编译推送docker镜像

docker build -t harbor.59iedu.com/fjhb/kong:2.3.2 .docker push harbor.59iedu.com/fjhb/kong:2.3.2

更新运行中的docker

  • 修改k8s的deployment文件,替换镜像版本后进行apply
  • 涉及到版本升级,需要进入init-container wait-for-migrations,分别执行下列命令,否则proxy和ingress-controller无法成功启动
    kong migrations upkong migrations finish
©著作权归作者所有:来自51CTO博客作者ylw6006的原创作品,谢绝转载,否则将追究法律责任

好知识,才能预见未来

赞赏

0人进行了赞赏支持

更多相关文章

  1. CDH 6.2.1 集成 freeipa
  2. 文件内容差异对比
  3. 对接海康AI Cloud智能应用平台
  4. kubesphere中Metrics Server故障排查
  5. docker es7.6 集群
  6. CDH kerberos web界面 freeipa
  7. ERROR 1047 (08S01)
  8. ERROR 1180 (HY000) at line
  9. CDH 启用kerberos

随机推荐

  1. Android Launcher2 allapps.rs
  2. 走进Android
  3. android 网络请求+json解析 最优分析
  4. Android之各种事件触发方案
  5. Android检测SD卡是否可用,Android获取磁盘
  6. android 3G pppd 调试记录
  7. Android EditText 的 android:imeOptions
  8. ProgressBar用法
  9. Android布局属性大全
  10. Android Bluetooth初始化流程