瀏覽代碼

适配调整emqx v4.3编译脚本,添加kafka消息桥接插件的支持

曹文涛 4 年之前
父節點
當前提交
e6d1e68ec9
共有 3 個文件被更改,包括 15 次插入1 次删除
  1. 1 0
      Makefile
  2. 13 1
      deploy/docker/Dockerfile
  3. 1 0
      lib-extra/plugins

+ 1 - 0
Makefile

@@ -3,6 +3,7 @@ REBAR_VERSION = 3.14.3-emqx-8
 REBAR = $(CURDIR)/rebar3
 REBAR = $(CURDIR)/rebar3
 BUILD = $(CURDIR)/build
 BUILD = $(CURDIR)/build
 SCRIPTS = $(CURDIR)/scripts
 SCRIPTS = $(CURDIR)/scripts
+export EMQX_EXTRA_PLUGINS = emqx_plugin_kafka
 export EMQX_DEFAULT_BUILDER = emqx/build-env:erl23.2.7.2-emqx-3-alpine
 export EMQX_DEFAULT_BUILDER = emqx/build-env:erl23.2.7.2-emqx-3-alpine
 export EMQX_DEFAULT_RUNNER = alpine:3.12
 export EMQX_DEFAULT_RUNNER = alpine:3.12
 export PKG_VSN ?= $(shell $(CURDIR)/pkg-vsn.sh)
 export PKG_VSN ?= $(shell $(CURDIR)/pkg-vsn.sh)

+ 13 - 1
deploy/docker/Dockerfile

@@ -2,6 +2,11 @@ ARG BUILD_FROM=emqx/build-env:erl23.2.7.2-emqx-3-alpine
 ARG RUN_FROM=alpine:3.12
 ARG RUN_FROM=alpine:3.12
 FROM ${BUILD_FROM} AS builder
 FROM ${BUILD_FROM} AS builder
 
 
+# 修改软件源地址为中科大的镜像地址地址,参见http://mirrors.ustc.edu.cn/help/alpine.html
+RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
+
+RUN apk update
+
 RUN apk add --no-cache \
 RUN apk add --no-cache \
     git \
     git \
     curl \
     curl \
@@ -46,6 +51,12 @@ COPY deploy/docker/docker-entrypoint.sh /usr/bin/
 COPY --from=builder /emqx/_build/$EMQX_NAME/rel/emqx /opt/emqx
 COPY --from=builder /emqx/_build/$EMQX_NAME/rel/emqx /opt/emqx
 
 
 RUN ln -s /opt/emqx/bin/* /usr/local/bin/
 RUN ln -s /opt/emqx/bin/* /usr/local/bin/
+
+# 修改软件源地址为中科大的镜像地址地址,参见http://mirrors.ustc.edu.cn/help/alpine.html
+RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
+
+RUN apk update
+
 RUN apk add --no-cache curl ncurses-libs openssl sudo libstdc++ bash
 RUN apk add --no-cache curl ncurses-libs openssl sudo libstdc++ bash
 
 
 WORKDIR /opt/emqx
 WORKDIR /opt/emqx
@@ -54,7 +65,8 @@ RUN adduser -D -u 1000 emqx \
     && echo "emqx ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers
     && echo "emqx ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers
 
 
 RUN chgrp -Rf emqx /opt/emqx && chmod -Rf g+w /opt/emqx \
 RUN chgrp -Rf emqx /opt/emqx && chmod -Rf g+w /opt/emqx \
-    && chown -Rf emqx /opt/emqx
+    && chown -Rf emqx /opt/emqx && chmod +x /usr/bin/docker-entrypoint.sh \
+    && chmod +x /opt/emqx/bin/*
 
 
 USER emqx
 USER emqx
 
 

+ 1 - 0
lib-extra/plugins

@@ -1,5 +1,6 @@
 {erlang_plugins,
 {erlang_plugins,
   [ {emqx_plugin_template, {git, "https://github.com/emqx/emqx-plugin-template", {tag, "4.3.0"}}}
   [ {emqx_plugin_template, {git, "https://github.com/emqx/emqx-plugin-template", {tag, "4.3.0"}}}
+  , {emqx_plugin_kafka, {git, "https://github.com/ULTRAKID/emqx_plugin_kafka.git", {tag, "main"}}}
   ]
   ]
 }.
 }.