Logrotate inside docker container not letting go of files?

Technical details:

Docker versions: This has happened on docker 18, 19 and 20, at several minor versions.

19.03.12 and 20.10.3 are the most recent installs I’ve got running.

OS: Ubuntu 16.04/18.04/20.04, all display this behavior.

All installs use overlay2.

Description:

Running lsof | grep -i 'deleted reveals log files being held on to, from processes running inside docker containers. Grepping the PID in the output of ps -aef --forest reveals the processes are running inside a docker container.

Running the same process outside docker has thus far not reproduced this behavior.

This started to become apparent when tens of gigabytes of diskspace could not be found.

This happens both for java and nodejs processes, using logback/winston respectively.

These logger libraries take care of their own logrotating and are not being tracked by a distinct logrotate service.

I have no clue what causes this behavior, and why it doesn’t happen when not dockerized.

Googling “docker logrotate files being held” just gives results on logrotating the log files of docker itself.

I’m not finding what I’m looking for with general searching, so I came here, to ask if maybe someone recognizes this and it’s actually an easy fix? Some simple thing I forgot but has to be pointed out?

Here’s hoping someone knows what’s going on.

Where can i find log of portainer.io on docker?

I just want to set up a fail2ban rule to prevent portainer connections, but I can’t find a log file of UI connections, and can’t even get into the container…
Version of portainer container : 2.6.3.

Docker containers keep shutting down

I ran docker-compose up on two docker containers and both ended up shutting down. I am not sure what’s causing this, but I am wondering if there’s a way to fix it. Both keeps shutting down after roughly 1-2 hours. I want to dockerize the application for production, but right now because it keeps shutting down, I can’t.

This is my php docker container:

mariadb_1  | 2021-09-07 14:46:53 0 (Note) mysqld (initiated by: unknown): Normal shutdown
mariadb_1  | 2021-09-07 14:46:53 0 (Note) Event Scheduler: Purging the queue. 0 events
mariadb_1  | 2021-09-07 14:46:53 0 (Note) InnoDB: FTS optimize thread exiting.
redis_1    | 1:signal-handler (1631026013) Received SIGTERM scheduling shutdown...
Exception in thread Thread-13:
Traceback (most recent call last):
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
FileNotFoundError: (Errno 2) No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "requests/adapters.py", line 449, in send
  File "urllib3/connectionpool.py", line 727, in urlopen
  File "urllib3/util/retry.py", line 403, in increment
  File "urllib3/packages/six.py", line 734, in reraise
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "threading.py", line 926, in _bootstrap_inner
  File "threading.py", line 870, in run
  File "compose/cli/log_printer.py", line 166, in tail_container_logs
  File "compose/cli/log_printer.py", line 197, in wait_on_exit
  File "compose/container.py", line 277, in wait
  File "docker/utils/decorators.py", line 19, in wrapped
  File "docker/api/container.py", line 1302, in wait
  File "docker/utils/decorators.py", line 46, in inner
  File "docker/api/client.py", line 224, in _post
  File "requests/sessions.py", line 578, in post
  File "requests/sessions.py", line 530, in request
  File "requests/sessions.py", line 643, in send
  File "requests/adapters.py", line 498, in send
requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

Exception in thread Thread-15:
Traceback (most recent call last):
  File "urllib3/response.py", line 696, in _update_chunk_length
ValueError: invalid literal for int() with base 16: b''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "urllib3/response.py", line 436, in _error_catcher
  File "urllib3/response.py", line 763, in read_chunked
  File "urllib3/response.py", line 700, in _update_chunk_length
http.client.IncompleteRead: IncompleteRead(0 bytes read)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "requests/models.py", line 751, in generate
  File "urllib3/response.py", line 571, in stream
  File "urllib3/response.py", line 792, in read_chunked
  File "contextlib.py", line 130, in __exit__
  File "urllib3/response.py", line 454, in _error_catcher
urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "threading.py", line 926, in _bootstrap_inner
  File "threading.py", line 870, in run
  File "compose/cli/log_printer.py", line 166, in tail_container_logs
  File "compose/cli/log_printer.py", line 197, in wait_on_exit
  File "compose/container.py", line 277, in wait
  File "docker/utils/decorators.py", line 19, in wrapped
  File "docker/api/container.py", line 1302, in wait
  File "docker/utils/decorators.py", line 46, in inner
  File "docker/api/client.py", line 224, in _post
  File "requests/sessions.py", line 578, in post
  File "requests/sessions.py", line 530, in request
  File "requests/sessions.py", line 685, in send
  File "requests/models.py", line 829, in content
  File "requests/models.py", line 754, in generate
requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))

Exception in thread Thread-10:
Traceback (most recent call last):
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
FileNotFoundError: (Errno 2) No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "requests/adapters.py", line 449, in send
  File "urllib3/connectionpool.py", line 727, in urlopen
  File "urllib3/util/retry.py", line 403, in increment
  File "urllib3/packages/six.py", line 734, in reraise
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "threading.py", line 926, in _bootstrap_inner
  File "threading.py", line 870, in run
  File "compose/cli/log_printer.py", line 166, in tail_container_logs
  File "compose/cli/log_printer.py", line 197, in wait_on_exit
  File "compose/container.py", line 277, in wait
  File "docker/utils/decorators.py", line 19, in wrapped
  File "docker/api/container.py", line 1302, in wait
  File "docker/utils/decorators.py", line 46, in inner
  File "docker/api/client.py", line 224, in _post
  File "requests/sessions.py", line 578, in post
  File "requests/sessions.py", line 530, in request
  File "requests/sessions.py", line 643, in send
  File "requests/adapters.py", line 498, in send
requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

Exception in thread Thread-14:
Traceback (most recent call last):
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
FileNotFoundError: (Errno 2) No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "requests/adapters.py", line 449, in send
  File "urllib3/connectionpool.py", line 727, in urlopen
  File "urllib3/util/retry.py", line 403, in increment
  File "urllib3/packages/six.py", line 734, in reraise
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "threading.py", line 926, in _bootstrap_inner
  File "threading.py", line 870, in run
  File "compose/cli/log_printer.py", line 166, in tail_container_logs
  File "compose/cli/log_printer.py", line 197, in wait_on_exit
  File "compose/container.py", line 277, in wait
  File "docker/utils/decorators.py", line 19, in wrapped
  File "docker/api/container.py", line 1302, in wait
  File "docker/utils/decorators.py", line 46, in inner
  File "docker/api/client.py", line 224, in _post
  File "requests/sessions.py", line 578, in post
  File "requests/sessions.py", line 530, in request
  File "requests/sessions.py", line 643, in send
  File "requests/adapters.py", line 498, in send
requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

Exception in thread Thread-11:
Traceback (most recent call last):
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
FileNotFoundError: (Errno 2) No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "requests/adapters.py", line 449, in send
  File "urllib3/connectionpool.py", line 727, in urlopen
  File "urllib3/util/retry.py", line 403, in increment
  File "urllib3/packages/six.py", line 734, in reraise
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "threading.py", line 926, in _bootstrap_inner
  File "threading.py", line 870, in run
  File "compose/cli/log_printer.py", line 166, in tail_container_logs
  File "compose/cli/log_printer.py", line 197, in wait_on_exit
  File "compose/container.py", line 277, in wait
  File "docker/utils/decorators.py", line 19, in wrapped
  File "docker/api/container.py", line 1302, in wait
  File "docker/utils/decorators.py", line 46, in inner
  File "docker/api/client.py", line 224, in _post
  File "requests/sessions.py", line 578, in post
  File "requests/sessions.py", line 530, in request
  File "requests/sessions.py", line 643, in send
  File "requests/adapters.py", line 498, in send
requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

Exception in thread Thread-12:
Traceback (most recent call last):
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
FileNotFoundError: (Errno 2) No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "requests/adapters.py", line 449, in send
  File "urllib3/connectionpool.py", line 727, in urlopen
  File "urllib3/util/retry.py", line 403, in increment
  File "urllib3/packages/six.py", line 734, in reraise
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "threading.py", line 926, in _bootstrap_inner
  File "threading.py", line 870, in run
  File "compose/cli/log_printer.py", line 166, in tail_container_logs
  File "compose/cli/log_printer.py", line 197, in wait_on_exit
  File "compose/container.py", line 277, in wait
  File "docker/utils/decorators.py", line 19, in wrapped
  File "docker/api/container.py", line 1302, in wait
  File "docker/utils/decorators.py", line 46, in inner
  File "docker/api/client.py", line 224, in _post
  File "requests/sessions.py", line 578, in post
  File "requests/sessions.py", line 530, in request
  File "requests/sessions.py", line 643, in send

This is my Docker-Traefik container:

traefik    | time="2021-09-07T14:46:53Z" level=debug msg="Entry point traefik closed" entryPointName=traefik
traefik    | time="2021-09-07T14:46:53Z" level=debug msg="Entry point other closed" entryPointName=other
traefik    | time="2021-09-07T14:46:53Z" level=debug msg="Entry point gulp-ui closed" entryPointName=gulp-ui
traefik    | time="2021-09-07T14:46:53Z" level=info msg="Server stopped"
traefik    | time="2021-09-07T14:46:53Z" level=info msg="Shutting down"
Exception in thread Thread-3:
Traceback (most recent call last):
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
FileNotFoundError: (Errno 2) No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "requests/adapters.py", line 449, in send
  File "urllib3/connectionpool.py", line 727, in urlopen
  File "urllib3/util/retry.py", line 403, in increment
  File "urllib3/packages/six.py", line 734, in reraise
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "threading.py", line 926, in _bootstrap_inner
  File "threading.py", line 870, in run
  File "compose/cli/log_printer.py", line 166, in tail_container_logs
  File "compose/cli/log_printer.py", line 197, in wait_on_exit
  File "compose/container.py", line 277, in wait
  File "docker/utils/decorators.py", line 19, in wrapped
  File "docker/api/container.py", line 1302, in wait
  File "docker/utils/decorators.py", line 46, in inner
  File "docker/api/client.py", line 224, in _post
  File "requests/sessions.py", line 578, in post
  File "requests/sessions.py", line 530, in request
  File "requests/sessions.py", line 643, in send
  File "requests/adapters.py", line 498, in send
requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

ubuntu@production:~/repo/Docker-Traefik$ 

These are my docker-compose files:

version: '3.7'
services:
 php:
  image: diana/${PROJECT}.php:tg1
  build:
   context: .
   dockerfile: './docker/php/Dockerfile'
  depends_on:
   - redis
   - mariadb
  command:
   - /bin/bash
   - -c
   - umask 000 && ./php-fpm-build.sh && php-fpm
  networks:
   - backend
  volumes:
   - ./matthews.com/:/var/www/:consistent
   - ./matthews.com/node_modules/:/var/www/node_modules/:cached
   - ./matthews.com/vendor/:/var/www/vendor/:cached
   - ./logs/php/:/var/log/matthews/:cached

 apache:
  image: diana/common.apache:tg1
  build: './docker/apache/'
  depends_on:
   - php
  networks:
   - frontend
   - backend
   - traefik
  labels:
   - traefik.http.routers.${COMPOSE_PROJECT_NAME}-apache.rule=${HTTPRULE}
   - traefik.http.routers.${COMPOSE_PROJECT_NAME}-apache.service=${COMPOSE_PROJECT_NAME}-apache
   - traefik.http.routers.${COMPOSE_PROJECT_NAME}-apache.entryPoints=web
   - traefik.http.services.${COMPOSE_PROJECT_NAME}-apache.loadbalancer.server.port=80

   - traefik.http.routers.${COMPOSE_PROJECT_NAME}-apache-ssl.rule=${HTTPRULE}
   - traefik.http.routers.${COMPOSE_PROJECT_NAME}-apache-ssl.entryPoints=websecure
   - traefik.http.routers.${COMPOSE_PROJECT_NAME}-apache-ssl.service=${COMPOSE_PROJECT_NAME}-apache-ssl
   - traefik.http.routers.${COMPOSE_PROJECT_NAME}-apache-ssl.tls=true
   - traefik.http.services.${COMPOSE_PROJECT_NAME}-apache-ssl.loadbalancer.server.port=80

   - traefik.enable=true
   - traefik.docker.network=webgateway
   - traefik.port=80
  volumes:
   - ./matthews.com/public:/var/www/public
   - ./docker/php/php.ini:/usr/local/etc/php/php.ini

 mariadb:
  image: diana/common.mariadb:tg1
  build: './docker/mariadb/'
  restart: always
  environment:
   MYSQL_ROOT_PASSWORD: ${ROOT_PASS}
   MYSQL_DATABASE: ${PROJECT}
   MYSQL_USER: ${PROJECT}
   MYSQL_PASSWORD: ${MARIADB_PASS}
   DBDUMP: ${DBDUMP}
   DATABASE: ${PROJECT}
  volumes:
   - db-data:/var/lib/mysql
   - ./docker/mariadb/import-dump.sh:/docker-entrypoint-initdb.d/a-import-dump.sh
  networks:
   - backend
  ports:
   - ${MARIADB_DEVPORT}:3306

volumes:
 db-data:

networks:
 frontend:
 backend:
 traefik:
  external:
   name: webgateway

And another:

version: "3.3"

services:

  traefik:
    image: matthewsdocker/traefik-dev:1.0.0.1
    container_name: "traefik"
    command:
      - /bin/sh
      - -c
      - sh /configuration/ssl-download.sh  && sh ./entrypoint.sh traefik
    build:
      context: .
      dockerfile: './docker/traefik/Dockerfile'

    restart: always
    
    ports:
      - "80:80"
      - "81:81"
      - "82:82"
      - "443:443"
      - "4431:4431"
      - "8080:8080"
      - "6001:6001"
      - "3000:3000"
      - "3001:3001"
      - "3002:3002"

    volumes:
      - ./configuration:/configuration
      - ./traefik.yml:/etc/traefik/traefik.yml
      - /var/run/docker.sock:/var/run/docker.sock:ro

    networks: 
      - webgateway

networks:
  webgateway:
    external: true

python – Reiniciar Docker(B) desde un Django ( que es el Docker A)

tengo problemas para intentar reiniciar un Docker desde un Django(que tambien es un docker). Los Dockers serán llamados “locator(docker b)” y “backend(docker a)”. El backend espera a que pulse un botón para enviar un os.system(“docker restart locator”). Funciona cuando esta en local pero no cuando están en un docker cada uno. Utilizo Ubuntu 20.04 y no es un problema de permisos. He probado con el sdk de docker para python y os.system() antes explicado. Esta claro que no lo detecta porque los dockers corren en paralelo y no se detectan entre si pero me gustaría tener claro si existe alguna manera de hacerlos interactuar o no entre ellos con python. El docker-compose que utilizo es este:

 locator:
      container_name: base-location
    image: registry.gitlab.com/image/locator:base-location
    volumes:
      - ./configs:/configs
      - ./logs/locator:/configs/logs
      - ./sniffing:/app/sniffing
    ports:
      - "3788:3788"
      - "3787:80"
    networks:
      - app_network
    depends_on:
      - rabbitmq
      - backend
    restart: always

  backend:
    container_name: backend
    environment:
      - prometheus_multiproc_dir=/dev/shm
    image: registry.gitlab.com/image2/backend:develop_fase1

    volumes:
      - ./configs:/configs
      - ./logs/backend:/app/logs
      - ./media:/app/media
    ports:
      - "8000:80"
    networks:
      - app_network
    depends_on:
      - postgres
      - grafana
    restart: always

Los comandos para levantar los dockers son:

  • docker-compose pull locator backend
  • docker-compose up -d locator backend

Muchas gracias!

drush – The database is not bootstrapped in another docker container

The following problem occurs when running certain Drush commands, such as drush en features which outputs:

Command pm-enable needs a higher bootstrap level to run – you will need to invoke drush from a more functional Drupal environment to run this command.
The drush command ‘en features’ could not be executed.
Drush was not able to start (bootstrap) the Drupal database.
Hint: This may occur when Drush is trying to:

  • bootstrap a site that has not been installed or does not have a configured database. In this case you can select another site with a working database setup by specifying the URI to use with the –uri parameter on the command line. See drush topic docs-aliases for details.
  • connect the database through a socket. The socket file may be wrong or the php-cli may have no access to it in a jailed shell. See http://drupal.org/node/1428638 for details.

Drush was attempting to connect to:

Drupal version: 7.58
Site URI: http://default
Database driver: mysql
Database hostname: mysql
Database port:
Database username: default
Database name: default
PHP executable: /usr/bin/php
PHP configuration: /etc/php/7.2/cli/php.ini
PHP OS: Linux
Drush script: /var/www/vendor/drush/drush/drush.php
Drush version: 8.1.17
Drush temp directory: /tmp
Drush configuration:
Drush alias files:
Drupal root: /var/www
Drupal Settings File: sites/default/settings.php
Site path: sites/default

This problem has been reported previously, but in different contexts, not in the specific setup I am working with, which consists of separate docker containers on a linux hosting server.

  • Apache 2
  • ElasticSearch
  • Workspace
  • PHP
  • MySQL

All the docker containers are running, as well as the (development) website that is built with drupal, which does connect to the database. Drush had previously been used for setting things up, but something seems to have broken during the development process. Drush had been added to the project using composer, as suggested on Install a site-local Drush and Drush Launcher.

The error seems independent of the directory where the command is executed. Moreover, the settings.php file exists at the path mentioned in the output above and contains the correct database configuration.

Finally, drush sql-cli returns the following message.

sh: 1: mysql: not found
SQL client error occurred.

Do you have any idea on what the problem might be?

linux – How can I configure Wireguard running in a docker container on a VPS to allow communication between its’ connected clients?

I have a VPS running WireGuard as a server in a docker container, where I’ve given it the devices I intend on adding as peers.

I have a home server running WireGuard as a client in a docker container using the host network mode. IP Forwarding is enabled on each of these servers.

When I connect with my laptop to the WireGuard host on the VPS, I’m unable to access my home server.

Am I approaching this wrong, or is there a simpler/better way to try to achieve this?
One of the reasons I’m wanting to configure this in this way is so that I can set up a reverse proxy to one of the services running on the home server over the tunnel.

Página não está funcionando, após utilizar Docker

criei uma aplicação Web com Django e quando executo o comando “python manage.py runserser” a página executa normalmente. Mas depois de executar o container do Docker a página consta como não estar funcionando:

docker-compose up -d

Creating network "devbook_default" with the default driver
Creating mongodb_container ... done
Creating devbook_web_1     ... done

Dockerfile:

    FROM python:3.9

    ENV PYTHONDONTWRIETBYTECODE 1
    ENV PYTHONNUMBUFFERED 1
    
    WORKDIR /projeto
    
    COPY requirements.txt .
    RUN pip install -r requirements.txt
    
    COPY . .

docker-compose.yml

version: "3.8"

services:
  web:
    build: .
    command: python manage.py runserver
    volumes:
      - .:/code
    ports:
      - 8000:8000
    depends_on:
      - db
  db:
    image: mongo
    container_name: mongodb_container
    ports:
    - "27017:27017"
    environment:
      - MONGO_INITDB_ROOT_NAME=Devbook
    volumes:
      - /data/db:/data/db

Usando o docker-compose ps

Name                    Command             State                      Ports
------------------------------------------------------------------------------------------------------
devbook_web_1       python manage.py runserver    Up      0.0.0.0:8000->8000/tcp,:::8000->8000/tcp
mongodb_container   docker-entrypoint.sh mongod   Up      0.0.0.0:27017->27017/tcp,:::27017->27017/tcp

Quando acesso a página localhost:8000 consta assim:
inserir a descrição da imagem aqui

docker – Dcoker compose – disable default gateway route

Is it possible to prevent docker from defining default route when using docker-compose yaml file?

If my docker-compose.yaml defines network ipam with default driver and any subnet, seams like docker (or docker compose) automatically assigns default route to the routing table of the docker that is attached to this network). Is there any way to disable it?

rhel8 – How to officially install latest Docker into offline RHEL 8 x86_64 machine?

I have an offline RHEL 8 x86_64 machine that I would like to install the latest version of Docker onto, ideally without needing a RHEL package mirror. This machine will never be connected to the Internet.

The official Docker docs provide a link to manual instructions: https://docs.docker.com/engine/install/rhel/#install-from-a-package. But following the link it provides (https://download.docker.com/linux/rhel/8) there seem to be binaries only for s390x architecture.

There are x86_64 rpms for CentOS 8: https://download.docker.com/linux/centos/8/x86_64/stable/Packages/. Are these compatible/recommended for RHEL 8? Given CentOS 8’s moved up end of life (https://wiki.centos.org/About/Product) are these rpms only a short-term solution?

Can docker service replace docker run?

I’m converting my Docker hosts into Docker Swarm Nodes. Before this I always ran Docker hosts/containers moreorless like a (vSAN-less) vSphere cluster with as little storage as possible per host centralizing it instead. Never run anything on the bridge network, only use dedicated addresses or the host’s network and avoid compose files so I don’t have to remember where they are or lose them with a failed host. I keep a single file of all the detailed docker runs commands (preceded with docker ..stop X & ..rm X for conflict prevention). The contents of the file can be copied and pasted or run as a script and containers are restored regardless where they’re run. Even the macvlans are recreated.

A second script sets up network mounts so paths are identical and cron jobs to sync certs (for symlinking) with a central server that requests them. Basically it was already clustered minus the automatic placement of containers. I’m “formally clustering” to gain that ability. I don’t need dynamic workload balancing or anything fancier that just being able to view all hosts in a single pane of glass so Swarm is perfect but I’m not sure how to transform my “docker runs” properly.

Is the docker service command a replacement for docker run? The examples in the documentation are extremely generic in details, the whole thing is very vague when it comes to swarm mode.

Also, what I think the equivalent options it has, introduce ambiguity. For instance, --volume isn’t there but there’s --mount. When I think of “volume” it’s storage on a disk/array that’s immediate to the system managing it, when I think or “mount”…sure, it can be local but with a bias to removable storage but really it’s network mounts what comes to mind. The description doesn’t clarify anything though, or if it is abstracted too or made as needed from a node to storage or what. Same for --network, can I choose one of the existing macvlan networks I used before or new networks are created on-the-fly or need to be created?

Thanks!