docker edgex host #254
Unanswered
wangqingpen
asked this question in
Q&A
Replies: 2 comments
-
you may just write down what you are modifying. |
Beta Was this translation helpful? Give feedback.
0 replies
-
by the way, you cannot just use the host ip unless you use the host network for all the containers |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When I use host the following modified docker yml
services:
command:
container_name: edgex-core-command
depends_on:
- consul
- database
- metadata
environment:
CLIENTS_CORE_COMMAND_HOST: 192.168.12.193
CLIENTS_CORE_DATA_HOST: 192.168.12.193
CLIENTS_CORE_METADATA_HOST: 192.168.12.193
CLIENTS_SUPPORT_NOTIFICATIONS_HOST: 192.168.12.193
CLIENTS_SUPPORT_SCHEDULER_HOST: 192.168.12.193
DATABASES_PRIMARY_HOST: 192.168.12.193
EDGEX_SECURITY_SECRET_STORE: "false"
MESSAGEQUEUE_EXTERNAL_URL: tcp://edgex-mqtt-broker:1883
MESSAGEQUEUE_HOST: 192.168.12.193
MESSAGEQUEUE_INTERNAL_HOST: 192.168.12.193
REGISTRY_HOST: 192.168.12.193
SERVICE_HOST: 192.168.12.193
hostname: edgex-core-command
image: edgexfoundry/core-command-arm64:2.3.0
network_mode: "host"
ports:
- 59882:59882/tcp
read_only: true
restart: always
security_opt:
- no-new-privileges:true
user: 2002:2001
consul:
command: agent -ui -bootstrap -server -client 0.0.0.0
container_name: edgex-core-consul
hostname: edgex-core-consul
image: consul:1.13.2
network_mode: "host"
ports:
- 8500:8500/tcp
read_only: true
restart: always
security_opt:
- no-new-privileges:true
user: root:root
volumes:
- consul-config:/consul/config:z
- consul-data:/consul/data:z
- /etc/localtime:/etc/localtime:ro
ui:
container_name: edgex-ui-go
environment:
EDGEX_SECURITY_SECRET_STORE: "false"
SERVICE_HOST: 192.168.12.193
hostname: edgex-ui-go
image: edgexfoundry/edgex-ui-arm64:2.3.0
network_mode: "host"
ports:
- 4000:4000/tcp
read_only: true
restart: always
security_opt:
- no-new-privileges:true
user: 2002:2001
portainer:
image: portainer/portainer
ports:
- "9000:9000"
container_name: portainer
command: -H unix:///var/run/docker.sock
volumes:
- /var/run/docker.sock:/var/run/docker.sock:z
- portainer_data:/data
When I get up docker, consul:1.13.2 Error response from daemon: No such container: consul:1.13.2 ,
edgex-ui
level=INFO ts=2024-03-01T02:47:34.459453012Z app=edgex-ui-service source=config.go:392 msg="Loaded service configuration from res/docker/configuration.toml"
level=INFO ts=2024-03-01T02:47:34.466273638Z app=edgex-ui-service source=variables.go:377 msg="Variables override of 'Service.Host' by environment variable: SERVICE_HOST=192.168.12.193"
level=INFO ts=2024-03-01T02:47:34.467612388Z app=edgex-ui-service source=config.go:556 msg="Using local configuration from file (1 envVars overrides applied)"
level=INFO ts=2024-03-01T02:47:34.475307722Z app=edgex-ui-service source=httpserver.go:133 msg="Web server starting (192.168.12.193:4000)"
level=INFO ts=2024-03-01T02:47:34.476997639Z app=edgex-ui-service source=message.go:50 msg="Service dependencies resolved..."
level=INFO ts=2024-03-01T02:47:34.477165055Z app=edgex-ui-service source=message.go:51 msg="Starting edgex-ui-service 2.3.0 "
level=INFO ts=2024-03-01T02:47:34.477273264Z app=edgex-ui-service source=message.go:55 msg="edgex-ui-go service started"
level=INFO ts=2024-03-01T02:47:34.477356972Z app=edgex-ui-service source=message.go:58 msg="Service started in: 19.970418ms"
level=ERROR ts=2024-03-01T02:47:34.47835243Z app=edgex-ui-service source=httpserver.go:147 msg="Web server failed: listen tcp 192.168.12.193:4000: bind: cannot assign requested address"
level=INFO ts=2024-03-01T02:47:34.478961722Z app=edgex-ui-service source=httpserver.go:130 msg="Web server shut down"
level=INFO ts=2024-03-01T02:47:35.453943987Z app=edgex-ui-service source=config.go:392 msg="Loaded service configuration from res/docker/configuration.toml"
level=INFO ts=2024-03-01T02:47:35.45660282Z app=edgex-ui-service source=variables.go:377 msg="Variables override of 'Service.Host' by environment variable: SERVICE_HOST=192.168.12.193"
level=INFO ts=2024-03-01T02:47:35.460398571Z app=edgex-ui-service source=config.go:556 msg="Using local configuration from file (1 envVars overrides applied)"
level=INFO ts=2024-03-01T02:47:35.482258115Z app=edgex-ui-service source=httpserver.go:133
It has not been modified to host, everything is normal,
The following is unmodified docker yml:
networks:
edgex-network:
driver: bridge
consul:
command: agent -ui -bootstrap -server -client 0.0.0.0
container_name: edgex-core-consul
hostname: edgex-core-consul
image: consul:1.13.2
networks:
edgex-network: {}
ports:
- 8500:8500/tcp
read_only: true
restart: always
security_opt:
- no-new-privileges:true
user: root:root
volumes:
- consul-config:/consul/config:z
- consul-data:/consul/data:z
- /etc/localtime:/etc/localtime:ro
- ui:
container_name: edgex-ui-go
environment:
EDGEX_SECURITY_SECRET_STORE: "false"
SERVICE_HOST: edgex-ui-go
hostname: edgex-ui-go
image: edgexfoundry/edgex-ui-arm64:2.3.0
networks:
edgex-network: {}
ports:
- 4000:4000/tcp
read_only: true
restart: always
security_opt:
- no-new-privileges:true
user: 2002:2001
portainer:
image: portainer/portainer
ports:
- "9000:9000"
container_name: portainer
command: -H unix:///var/run/docker.sock
volumes:
- /var/run/docker.sock:/var/run/docker.sock:z
- portainer_data:/data
Beta Was this translation helpful? Give feedback.
All reactions