I followed this guide to install Nginx Proxy Manager (NPM). When I try to create a stack, I get this error:
failed to deploy a stack: npm-db Pulling npm-app Pulling npm-app Error
npm-db Error Error response from daemon: Get
"https://registry-1.docker.io/v2/": net/http: request canceled while
waiting for connection (Client.Timeout exceeded while awaiting
headers)
I understand that the solution might be in this post but how can I fix it in my case?
version: '3'
services:
app:
container_name: proxy
image: jc21/nginx-proxy-manager:latest
restart: unless-stopped
ports:
- '80:80'
- '81:81'
- '443:443'
volumes:
- data:/data
- letsencrypt:/etc/letsencrypt
volumes:
data: {}
letsencrypt: {}
Related
I have 3 containers and the main container - con_a - should make requests to others. When con_a makes an HTTP request, the other container's response is "502 Timeout". The details of containers and requests are below. When I try to make a request with curl in the console, there is no problem and the request is working.
Docker-compose.yml
version: "3"
services:
con_a:
networks:
- my_net
con_b:
container_name: con_b
hostname: con_b
ports:
- "9200:9200"
- "9300:9300"
networks:
- my_net
con_c:
container_name: con_c
image: con_c
hostname: con_c
build: ./con_c
ports:
- "1337:1337"
networks:
- my_net
networks:
my_net:
driver: bridge
The request in the con_a
response = requests.get("http://con_c:1337/health_check")
The request is normally just return "success".
The response
'<HEAD><TITLE>Connection timed out</TITLE></HEAD>\n<BODY BGCOLOR="white" FGCOLOR="black"><H1>Connection timed out</H1><HR>\n<FONT FACE="Helvetica,Arial"><B>\nDescription: Connection timed out</B></FONT>\n<HR>\n<!-- default "Connection timed out" response (502) -->\n</BODY>\n'
Python request problem
I thought the problem is about the docker networking problem, but the problem was python's automation. The request contains more settings than my settings and before the get request, I add a trust environment settings like the other post. I found the solution in this post: python request problem
I cant get docker-registry working behind a https-proxy. I use traefik for all containers on my server, so i will do with the registry. here is my docker-compose.yml for the registry service, it should use a letsencrypt cert:
version: "3.3"
services:
registry:
image: registry:latest
container_name: docker_registry
restart: always
volumes:
- /srv/docker-registry/data:/data
- /srv/docker-registry/auth:/auth
environment:
- REGISTRY_AUTH=htpasswd
- REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm
- REGISTRY_AUTH_HTPASSWD_PATH=/auth/.htpasswd
- REGISTRY_LOG_LEVEL=debug
- REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/data
labels:
- "traefik.enable=true"
- "traefik.http.routers.registry.entrypoints=http"
- "traefik.http.routers.registry.rule=Host(`registry.example.de`)"
- "traefik.http.middlewares.registry-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.registry.middlewares=registry-https-redirect"
- "traefik.http.services.registry-secure.loadbalancer.server.port=5000"
- "traefik.http.services.registry-secure.loadbalancer.server.scheme=https"
- "traefik.http.routers.registry-secure.entrypoints=https"
- "traefik.http.routers.registry-secure.tls.certresolver=http"
- "traefik.http.routers.registry-secure.tls=true"
- "traefik.http.routers.registry-secure.rule=Host(`registry.example.de`)"
networks:
- proxy
networks:
proxy:
external: true
The Error i Get on docker login:
Error response from daemon: Get "https://registry.example.de:5000/v2/": dialing registry.example.de:5000 static system has no HTTPS proxy: connecting to 202.xx.xxx.xxx:5000: dial tcp 202.xx.xxx.xxx:5000: connect: connection refused
registry:2 listens on http. Drop "traefik.http.services.registry-secure.loadbalancer.server.scheme=https"
I am setting up a local Azure Blob Storage using Docker container & Docker-compose.
However, when I start creating blob containers and uploading files it throws me the error as below.
azure.common.AzureException: HTTPConnectionPool(host='127.0.0.1', port=10000): Max retries exceeded with url: /devstoreaccount1/quickstartblobs?restype=container (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f1068d0f748>: Failed to establish a new connection: [Errno 111] Connection refused',))
Here is my docker-compose:
version: "3.9"
services:
db:
image: postgres
volumes:
- ./data/db:/var/lib/postgresql/data
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- DEBUG=FALSE
- AZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=https;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=https://127.0.0.1:10000/devstoreaccount1;
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- 8000:8000
- 5678:5678
depends_on:
- db
azurite:
image: mcr.microsoft.com/azure-storage/azurite
ports:
- "127.0.0.1:10000:10000"
Requirements.txt
djangorestframework==3.11.2
Django==3.1.8
Pygments==2.7.4
Markdown==3.2.1
coreapi==2.3.3
psycopg2-binary==2.8.4
dj-database-url==0.5.0
gunicorn==20.0.4
whitenoise==5.0.1
PyYAML==5.4
azure-storage-blob==2.1.0
ptvsd==4.3.2
azure-common==1.1.23
azure-storage-common==2.1.0
requests==2.25.1
six==1.11.0
urllib3==1.26.3
Code:
blob_service_client = BlockBlobService(
account_name='devstoreaccount1', account_key='Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==',is_emulated=True)
# Create a container called 'quickstartblobs'.
container_name = 'quickstartblobs'
blob_service_client.create_container(container_name)
You can remove the ports section for azurite service in your compose file and in your application provide the connection string and specify the blob endpoint (as mentioned here: https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azurite#connection-strings) as BlobEndpoint=http://azurite:10000
When you use docker local bridge (created for services where deployed using compose), container name if provided explicitly else the service name can be used to access the service.
I have 2 working containers for Hadoop HDFS (I have built a Dockerfile for them starting from the one here) and need to add a HIVE instance to the set.
I cannot find a good working image to use (it would be nice to have version 2.3.4).
Is there anything you suggest, easy to add, that I could use?
Thank you!
Edit:
Here is a try I did:
hive-server:
container_name: hive-server
image: bde2020/hive:2.3.2-postgresql-metastore
depends_on:
- hadoop-namenode
env_file:
- ./hive_build/hadoop-hive.env
environment:
HIVE_CORE_CONF_javax_jdo_option_ConnectionURL: "jdbc:postgresql://hive-metastore/metastore"
SERVICE_PRECONDITION: "hive-metastore:9083"
ports:
- "10000:10000"
restart: unless-stopped
hive-metastore:
container_name: hive-metastore
image: bde2020/hive:2.3.2-postgresql-metastore
depends_on:
- hive-server
- hive-metastore-postgresql
env_file:
- ./hive_build/hadoop-hive.env
command: /opt/hive/bin/hive --service metastore
environment:
SERVICE_PRECONDITION: "hadoop-namenode:50070 hadoop-datanode1:50075 hive-metastore-postgresql:5432"
ports:
- "9083:9083"
restart: unless-stopped
hive-metastore-postgresql:
container_name: hive-metastore-postgresql
image: bde2020/hive-metastore-postgresql:2.3.0
ports:
- "5433:5432"
restart: unless-stopped
but when I enter it and try to connect I get an error:
docker exec -it hive-server bash
/opt/hive/bin/beeline -u jdbc:hive2://localhost:10000
error:
19/05/03 09:13:46 [main]: WARN jdbc.HiveConnection: Failed to connect to localhost:10000
Could not open connection to the HS2 server. Please check the server URI and if the URI is correct, then ask the administrator to check the server status.
Error: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:10000: java.net.ConnectException: Connection refused (Connection refused) (state=08S01,code=0)
i have a simple spring cloud project,and it contains 4 services:
config:8888
registry(eureka):8761
gateway(zuul):8080
service-1:9527
enter image description here
the project has no problem if deployed in localhost,
i can successfully fetch service-1's api by zuul without docker:
http://localhost:8080/service-1/test
but when i deployed with docker,
it throws error: Caused by: java.lang.RuntimeException: org.apache.http.conn.HttpHostConnectException: Connect to registry:9527 [registry/172.21.0.4] failed: Connection refused (Connection refused)
i can only fetch with service-1's api
http://localhost:9527/test
PS: the two services(gateway,service-1) has been success registry to eureka
here is my docker-compose yml :
version: '3'
services:
config:
build: ./config
ports:
- "8888:8888"
registry:
build: ./registry
ports:
- "8761:8761"
depends_on:
- config
environment:
- SPRING_PROFILES_ACTIVE=prd
gateway:
build: ./gateway
depends_on:
- config
links:
- registry
- service-1
ports:
- "8080:8080"
environment:
- SPRING_PROFILES_ACTIVE=prd
service-1:
build: ./service-1
ports:
- "9527:9527"
depends_on:
- config
links:
- registry
environment:
- SPRING_PROFILES_ACTIVE=prd
can anyone help me?
i have solved this issue , i forgot add #EnableDiscoveryClient on gateway main class,and cover the eureka instance hostname