emqxarchive / emqx-docker

This repository is no longer maintained, please go to https://github.com/emqx/emqx-rel/tree/master/deploy/docker
Apache License 2.0
235 stars 162 forks source link

Can I create default users at startup? #111

Open Ciruxx opened 5 years ago

Ciruxx commented 5 years ago

EMQ version

emqx/emqx:latest --> 3.1.1

Docker version

Which docker-engine version?

Docker version 18.09.5-ce, build e8ff056dbc

How docker info?

Containers: 21 Running: 1 Paused: 0 Stopped: 20 Images: 916 Server Version: 18.09.5-ce Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: false Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: runc Default Runtime: runc Init Binary: docker-init containerd version: 894b81a4b802e4eb2a91d1ce216b8817763c29fb.m runc version: 69ae5da6afdcaaf38285a10b36f362e41cb298d6 init version: fec3683 Security Options: seccomp Profile: default Kernel Version: 4.19.36-1-MANJARO Operating System: Manjaro Linux OSType: linux Architecture: x86_64 CPUs: 4 Total Memory: 7.494GiB Name: superasus ID: JAUE:7XYH:PR6U:YWPS:BOHG:JENZ:N2OK:KHJH:5JGI:NDBT:IZN2:UEUR Docker Root Dir: /var/lib/docker Debug Mode (client): false Debug Mode (server): false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false

Question

I'm sorry for my english.

Hi, I'm starting to use emqx recently, is there a way to create default users via docker-compose env?

I searched the official guide and saw that the tool to do this should be

emqx_ctl admins add root public test

This command should create a new admin user with name "root", password "public" and tagged with "test" tag if I understand correctly.

Is there a way to do this via docker?

Rory-Z commented 5 years ago

@Ciruxx Sorry to reply so late We don't currently support creating admins via environment variables. If you need to, you can edit start.sh and build your own docker image.