Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new image for nanomq #13776

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Rory-Z
Copy link
Contributor

@Rory-Z Rory-Z commented Dec 21, 2022

Checklist for Review

NOTE: This checklist is intended for the use of the Official Images maintainers both to track the status of your PR and to help inform you and others of where we're at. As such, please leave the "checking" of items to the repository maintainers. If there is a point below for which you would like to provide additional information or note completion, please do so by commenting on the PR. Thanks! (and thanks for staying patient with us ❤️)

  • associated with or contacted upstream?
  • available under an OSI-approved license?
  • does it fit into one of the common categories? ("service", "language stack", "base distribution")
  • is it reasonably popular, or does it solve a particular use case well?
  • does a documentation PR exist? (should be reviewed and merged at roughly the same time so that we don't have an empty image page on the Hub for very long)
  • official-images maintainer dockerization review for best practices and cache gotchas/improvements (ala the official review guidelines)?
  • 2+ official-images maintainer dockerization review?
  • existing official images have been considered as a base? (ie, if foobar needs Node.js, has FROM node:... instead of grabbing node via other means been considered?)
  • if FROM scratch, tarballs only exist in a single commit within the associated history?
  • passes current tests? any simple new tests that might be appropriate to add? (https://github.com/docker-library/official-images/tree/master/test)

@github-actions
Copy link

Diff for a838447:
diff --git a/_bashbrew-cat b/_bashbrew-cat
index bdfae4a..a1a4c00 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -1 +1,20 @@
-Maintainers: New Image! :D (@docker-library-bot)
+Maintainers: Rory Z <[email protected]> (@rory-z)
+GitRepo: https://github.com/emqx/nanomq-docker.git
+GitFetch: refs/heads/main
+
+Tags: 0.14.8, 0.14, latest
+Architectures: amd64, arm32v7, arm64v8
+GitCommit: 475d76673515a065fc89e9aea299d2945452fdcb
+Directory: 0.14
+
+Tags: 0.14.8-full, 0.14-full, full
+Architectures: amd64, arm32v7, arm64v8
+GitCommit: 475d76673515a065fc89e9aea299d2945452fdcb
+Directory: 0.14
+File: Dockerfile-full
+
+Tags: 0.14.8-slim, 0.14-slim, slim
+Architectures: amd64, arm32v7, arm64v8
+GitCommit: 475d76673515a065fc89e9aea299d2945452fdcb
+Directory: 0.14
+File: Dockerfile-slim
diff --git a/_bashbrew-list b/_bashbrew-list
index e69de29..4b41648 100644
--- a/_bashbrew-list
+++ b/_bashbrew-list
@@ -0,0 +1,9 @@
+nanomq:0.14
+nanomq:0.14-full
+nanomq:0.14-slim
+nanomq:0.14.8
+nanomq:0.14.8-full
+nanomq:0.14.8-slim
+nanomq:full
+nanomq:latest
+nanomq:slim
diff --git a/_bashbrew-list-build-order b/_bashbrew-list-build-order
index e69de29..1d31810 100644
--- a/_bashbrew-list-build-order
+++ b/_bashbrew-list-build-order
@@ -0,0 +1,3 @@
+nanomq:latest
+nanomq:full
+nanomq:slim
diff --git a/nanomq_full/Dockerfile-full b/nanomq_full/Dockerfile-full
new file mode 100644
index 0000000..1a48cd9
--- /dev/null
+++ b/nanomq_full/Dockerfile-full
@@ -0,0 +1,24 @@
+FROM ubuntu:20.04
+
+ENV VSN=0.14.8
+
+RUN set -eu; \
+    apt update -y -y --no-install-recommends;\
+    DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends libmbedtls-dev libatomic1 curl; \
+    rm -rf /var/lib/apt/lists/*
+
+RUN set -eu; \
+    curl --silent --show-error -kfL -o nanomq.deb.sha256 "https://github.com/emqx/nanomq/releases/download/${VSN}/nanomq-${VSN}-linux-$(dpkg --print-architecture)-full.deb.sha256"; \
+    curl --silent --show-error -kfL -o nanomq.deb "https://github.com/emqx/nanomq/releases/download/${VSN}/nanomq-${VSN}-linux-$(dpkg --print-architecture)-full.deb"; \
+     echo "$(cat nanomq.deb.sha256) nanomq.deb" | sha256sum -c || exit 1; \
+    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ./nanomq.deb; \
+    ldconfig; \
+    rm -rf nanomq.deb nanomq.deb.sha256
+
+EXPOSE 1883 8883 8081
+
+COPY docker-entrypoint.sh /usr/bin/docker-entrypoint.sh
+
+ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
+
+CMD ["--conf", "/etc/nanomq.conf"]
diff --git a/nanomq_full/docker-entrypoint.sh b/nanomq_full/docker-entrypoint.sh
new file mode 100755
index 0000000..0a7e624
--- /dev/null
+++ b/nanomq_full/docker-entrypoint.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+if [ -n "$DEBUG" ]; then
+    set -ex
+else
+    set -e
+fi
+
+_main() {
+	if [ -f "/tmp/nanomq/nanomq.pid" ];then
+		rm -f /tmp/nanomq/nanomq.pid
+	fi
+
+	if [ "${1#-}" != "$1" ]; then
+		set -- nanomq start "$@"
+	fi
+    exec "$@"
+}
+
+_main "$@"
diff --git a/nanomq_latest/Dockerfile b/nanomq_latest/Dockerfile
new file mode 100644
index 0000000..4f8fccf
--- /dev/null
+++ b/nanomq_latest/Dockerfile
@@ -0,0 +1,40 @@
+FROM alpine:3.16 as builder
+
+RUN apk add gcc cmake make musl-dev g++ curl
+
+ENV VSN=0.14.8
+RUN set -eu; \
+    curl --silent --show-error -kfL -o nanomq.tar.gz "https://github.com/emqx/nanomq/archive/refs/tags/${VSN}.tar.gz"; \
+    mkdir -p nanomq; \
+    tar -zxf nanomq.tar.gz -C nanomq --strip-components 1;\
+    rm -f nanomq.tar.gz
+
+ENV NNGVSN=0.14.5
+RUN set -eu; \
+    curl --silent --show-error -kfL -o nanonng.tar.gz "https://github.com/nanomq/NanoNNG/archive/refs/tags/${NNGVSN}.tar.gz"; \
+    mkdir -p nanomq/nng; \
+    tar -zxf nanonng.tar.gz -C nanomq/nng --strip-components 1;\
+    rm -f nanonng.tar.gz
+
+WORKDIR /nanomq/build
+
+RUN cmake .. && make
+
+FROM alpine:3.16
+
+COPY --from=builder /nanomq/build/nanomq/nanomq /usr/local/nanomq/
+COPY --from=builder /nanomq/build/nanomq_cli/nanomq_cli /usr/local/nanomq/
+COPY --from=builder /nanomq/etc/nanomq.conf /etc/nanomq.conf
+COPY --from=builder /usr/lib/libgcc_s.so.1 /usr/lib/
+COPY docker-entrypoint.sh /usr/bin/docker-entrypoint.sh
+
+WORKDIR /usr/local/nanomq
+
+RUN ln -s /usr/local/nanomq/nanomq /usr/bin/nanomq && \
+    ln -s /usr/local/nanomq/nanomq_cli /usr/bin/nanomq_cli
+
+EXPOSE 1883
+
+ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
+
+CMD ["--url", "nmq-tcp://0.0.0.0:1883"]
diff --git a/nanomq_latest/docker-entrypoint.sh b/nanomq_latest/docker-entrypoint.sh
new file mode 100755
index 0000000..0a7e624
--- /dev/null
+++ b/nanomq_latest/docker-entrypoint.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+if [ -n "$DEBUG" ]; then
+    set -ex
+else
+    set -e
+fi
+
+_main() {
+	if [ -f "/tmp/nanomq/nanomq.pid" ];then
+		rm -f /tmp/nanomq/nanomq.pid
+	fi
+
+	if [ "${1#-}" != "$1" ]; then
+		set -- nanomq start "$@"
+	fi
+    exec "$@"
+}
+
+_main "$@"
diff --git a/nanomq_slim/Dockerfile-slim b/nanomq_slim/Dockerfile-slim
new file mode 100644
index 0000000..f78fd6d
--- /dev/null
+++ b/nanomq_slim/Dockerfile-slim
@@ -0,0 +1,24 @@
+FROM debian:11-slim
+
+ENV VSN=0.14.8
+
+RUN set -eu; \
+    apt update -y -y --no-install-recommends;\
+    DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends libmbedtls-dev libatomic1 curl; \
+    rm -rf /var/lib/apt/lists/*
+
+RUN set -eu; \
+    curl --silent --show-error -kfL -o nanomq.deb.sha256 "https://github.com/emqx/nanomq/releases/download/${VSN}/nanomq-${VSN}-linux-$(dpkg --print-architecture).deb.sha256"; \
+    curl --silent --show-error -kfL -o nanomq.deb "https://github.com/emqx/nanomq/releases/download/${VSN}/nanomq-${VSN}-linux-$(dpkg --print-architecture).deb"; \
+     echo "$(cat nanomq.deb.sha256) nanomq.deb" | sha256sum -c || exit 1; \
+    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ./nanomq.deb; \
+    ldconfig; \
+    rm -rf nanomq.deb nanomq.deb.sha256
+
+EXPOSE 1883 8883 8081
+
+COPY docker-entrypoint.sh /usr/bin/docker-entrypoint.sh
+
+ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
+
+CMD ["--conf", "/etc/nanomq.conf"]
diff --git a/nanomq_slim/docker-entrypoint.sh b/nanomq_slim/docker-entrypoint.sh
new file mode 100755
index 0000000..0a7e624
--- /dev/null
+++ b/nanomq_slim/docker-entrypoint.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+if [ -n "$DEBUG" ]; then
+    set -ex
+else
+    set -e
+fi
+
+_main() {
+	if [ -f "/tmp/nanomq/nanomq.pid" ];then
+		rm -f /tmp/nanomq/nanomq.pid
+	fi
+
+	if [ "${1#-}" != "$1" ]; then
+		set -- nanomq start "$@"
+	fi
+    exec "$@"
+}
+
+_main "$@"

@yosifkit
Copy link
Member

Hello! ✨

Thanks for your interest in contributing to the official images program. 💭

As you may have noticed, we've usually got a pretty decently sized queue of new images (not to mention image updates and maintenance of images under @docker-library which are maintained by the core official images team). As such, it may be some time before we get to reviewing this image (image updates get priority both because users expect them and because reviewing new images is a more involved process than reviewing updates), so we apologize in advance! Please be patient with us -- rest assured, we've seen your PR and it's in the queue. ❤️

We do try to proactively add and update the "new image checklist" on each PR, so if you haven't looked at it yet, that's a good use of time while you wait. ☔

Thanks! 💖 💙 💚 ❤️

@Rory-Z
Copy link
Contributor Author

Rory-Z commented Jan 10, 2023

Hi, @yosifkit Thanks for your reply.
I will wait patiently for your review and thank you for your work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants