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

Consul image fail to start in Docker #20938

Open
JiaLinYou opened this issue Mar 30, 2024 · 0 comments
Open

Consul image fail to start in Docker #20938

JiaLinYou opened this issue Mar 30, 2024 · 0 comments

Comments

@JiaLinYou
Copy link

Description

When I used Docker to build a Consul cluster, an error occurred when starting the first Consul server agent in cluster mode, and the container has been trying to restart.
And another command can start successfully.
May I ask which parameters caused Consul to fail to start? How should I resolve this?

Environment

Consul image: hashicorp/consul:1.17.3
Docker version: 24.0.6
Script language: CMD

The failed startup command I used

docker run -d --name=consul-server-node1 --restart=always ^
                -e "CONSUL_LOCAL_CONFIG={"skip_leave_on_interrupt": true}" ^
		-p 8300:8300 ^
		-p 8301:8301 ^		
		-p 8302:8302 ^
		-p 8500:8500 ^
		-p 8600:8600 ^
		-h node1 ^
		hashicorp/consul:1.17.3 agent -server -ui -bind=0.0.0.0 -node=server-1 -bootstrap-expect=3 -client 0.0.0.0 ^
                -data-dir=/tmp/data-dir

The docker container Logs

2024-03-30 11:39:46 ==> failed to parse /consul/config/local.json: invalid character 's' looking for beginning of object key string
2024-03-30 11:40:47 ==> failed to parse /consul/config/local.json: invalid character 's' looking for beginning of object key string

Screenshots

image
image

Command that can be successfully launched

docker run -d --name=badger --restart=always ^
		-p 8500:8500 ^
		-p 8600:8600/udp ^
		-h node2 ^
		hashicorp/consul:1.17.3 agent -server -ui -bind=0.0.0.0 -node=server-1 -bootstrap-expect=3 -client=0.0.0.0 ^
		-data-dir=/tmp/data-dir

Screenshots

image

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

No branches or pull requests

1 participant