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

Some fin commands leave a docksal/empty container behind. #1064

Closed
fuzzbomb opened this issue May 23, 2019 · 3 comments
Closed

Some fin commands leave a docksal/empty container behind. #1064

fuzzbomb opened this issue May 23, 2019 · 3 comments
Assignees
Labels

Comments

@fuzzbomb
Copy link
Contributor

Description

Some fin commands result in a randomly-named container being left behind (based on the docksal/empty image). After using Docksal for a number of projects, you can accumulate a lot of these docksal/empty containers, and they have to be manually pruned with docker rm.

Steps to reproduce the issue:

  1. Assuming you have a Docksal project already, and you are in the Docksal project root directory...
  2. Run docker ps -a to get a list of all containers. Keep the output handy somewhere, to use for comparison later.
  3. Run fin addon install adminer. Wait until finished.
  4. Run docker ps -a again. Note that the adminer container has been added, AND a randomly named container has also been created, from the docksal/empty image.

Describe the results you received:
After installing the adminer addon, we see that the adminer container has been created, and another randomly-named container was created a few seconds earlier. Specimen output from docker ps -a follows:

CONTAINER ID        IMAGE                        COMMAND                  CREATED             STATUS                       PORTS                                                    NAMES
6d3514a0ef68        adminer                      "entrypoint.sh docke…"   50 seconds ago      Up 49 seconds                8080/tcp                                                 d8media_adminer_1
6e63fa4b8b99        docksal/empty                "/bin/sh"                52 seconds ago      Exited (0) 51 seconds ago                                                             elegant_bartik
0157e4384d8d        docksal/apache:2.4-2.3       "httpd-foreground"       5 minutes ago       Up 5 minutes (healthy)       80/tcp, 443/tcp                                          d8media_web_1
73fa6af8258a        docksal/cli:2.6-php7.2       "/opt/startup.sh sup…"   6 minutes ago       Up 49 seconds (healthy)      22/tcp, 3000/tcp, 9000/tcp                               d8media_cli_1
8b11eda0578c        docksal/mysql:5.6-1.4        "docker-entrypoint.s…"   6 minutes ago       Up 6 minutes (healthy)       0.0.0.0:32768->3306/tcp                                  d8media_db_1
b65701ced8cc        docksal/ssh-agent:1.2        "docker-entrypoint.s…"   8 days ago          Up About an hour (healthy)                                                            docksal-ssh-agent
381fda0ef946        docksal/dns:1.1              "docker-entrypoint.s…"   8 days ago          Up About an hour (healthy)   192.168.64.100:53->53/udp                                docksal-dns
e286cbc3168f        docksal/vhost-proxy:1.5      "docker-entrypoint.s…"   8 days ago          Up About an hour (healthy)   192.168.64.100:80->80/tcp, 192.168.64.100:443->443/tcp   docksal-vhost-proxy
...
... more containers, not relevant

Describe the results you expected:
I wasn't expecting to see the extra docksal/empty container.

Is this a single-use container, that could be removed by fin after it has done it's job?

The only mention of this image in the fin script is in a function called is_docker_path(). Tracing this back through check_docker_path(), it looks like these containers are being created anytime up() is run.

Output of fin config:

fin config output
---------------------
COMPOSE_PROJECT_NAME_SAFE: d8media
COMPOSE_FILE:
/home/andrew/.docksal/stacks/volumes-bind.yml
/home/andrew/.docksal/stacks/stack-default.yml
/home/andrew/web-projects/floss/d8media/.docksal/docksal.yml
ENV_FILE:
/home/andrew/web-projects/floss/d8media/.docksal/docksal.env

PROJECT_ROOT: /home/andrew/web-projects/floss/d8media
DOCROOT: docroot
VIRTUAL_HOST: d8media.docksal
VIRTUAL_HOST_ALIASES: *.d8media.docksal
IP: 192.168.64.100
MYSQL: 192.168.64.100:32768

Docker Compose configuration
---------------------
services:
  adminer:
    environment:
      ADMINER_DEFAULT_SERVER: db
      ADMINER_DESIGN: price
      ADMINER_PLUGINS: tables-filter tinymce
    hostname: adminer
    image: adminer
    labels:
      io.docksal.virtual-host: adminer.d8media.docksal
  cli:
    dns:
    - 192.168.64.100
    - 8.8.8.8
    environment:
      BLACKFIRE_CLIENT_ID: null
      BLACKFIRE_CLIENT_TOKEN: null
      DOCROOT: docroot
      DRUSH_ALLOW_XDEBUG: '1'
      GIT_USER_EMAIL: hopscotch23@gmail.com
      GIT_USER_NAME: Andrew Macpherson
      HOST_GID: '1000'
      HOST_UID: '1000'
      PHP_IDE_CONFIG: serverName=d8media.docksal
      SECRET_ACAPI_EMAIL: null
      SECRET_ACAPI_KEY: null
      SECRET_PLATFORMSH_CLI_TOKEN: null
      SECRET_SSH_PRIVATE_KEY: null
      SECRET_TERMINUS_TOKEN: null
      VIRTUAL_HOST: d8media.docksal
      XDEBUG_CONFIG: remote_connect_back=0 remote_host=192.168.64.1
      XDEBUG_ENABLED: '1'
    hostname: cli
    image: docksal/cli:2.6-php7.2
    volumes:
    - docksal_ssh_agent:/.ssh-agent:ro
    - cli_home:/home/docker:rw
    - project_root:/var/www:rw,nocopy
  db:
    dns:
    - 192.168.64.100
    - 8.8.8.8
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: null
      MYSQL_DATABASE: default
      MYSQL_INITDB_SKIP_TZINFO: null
      MYSQL_ONETIME_PASSWORD: null
      MYSQL_PASSWORD: user
      MYSQL_RANDOM_ROOT_PASSWORD: null
      MYSQL_ROOT_PASSWORD: root
      MYSQL_USER: user
    hostname: db
    image: docksal/mysql:5.6-1.4
    ports:
    - 3306/tcp
    volumes:
    - db_data:/var/lib/mysql:rw
    - project_root:/var/www:ro,nocopy
  web:
    depends_on:
      cli:
        condition: service_started
    dns:
    - 192.168.64.100
    - 8.8.8.8
    environment:
      APACHE_BASIC_AUTH_PASS: null
      APACHE_BASIC_AUTH_USER: null
      APACHE_DOCUMENTROOT: /var/www/docroot
      APACHE_FCGI_HOST_PORT: cli:9000
    hostname: web
    image: docksal/apache:2.4-2.3
    labels:
      io.docksal.cert-name: none
      io.docksal.permanent: "false"
      io.docksal.project-root: /home/andrew/web-projects/floss/d8media
      io.docksal.virtual-host: d8media.docksal,*.d8media.docksal,d8media.docksal.*
    volumes:
    - project_root:/var/www:ro,nocopy
version: '2.1'
volumes:
  cli_home: {}
  db_data: {}
  docksal_ssh_agent:
    external: true
    name: docksal_ssh_agent
  project_root:
    driver: local
    driver_opts:
      device: /home/andrew/web-projects/floss/d8media
      o: bind
      type: none


Output of fin sysinfo:

fin sysinfo output (Note: I censored one of my project names in the output below.)
███  OS
Linux Ubuntu 19.04
Linux quinx 5.0.0-15-generic #16-Ubuntu SMP Mon May 6 17:41:33 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

███  ENVIRONMENT
MODE : Linux Kernel
DOCKER_HOST : 

███  FIN
fin version: 1.85.1

███  DOCKER COMPOSE
EXPECTED VERSION: 1.23.2
docker-compose version 1.23.2, build 1110ad01
docker-py version: 3.6.0
CPython version: 3.6.7
OpenSSL version: OpenSSL 1.1.0f  25 May 2017

███  DOCKER
EXPECTED VERSION: 18.09.2

Client:
Version:           18.09.6
API version:       1.39
Go version:        go1.10.8
Git commit:        481bc77156
Built:             Sat May  4 02:35:29 2019
OS/Arch:           linux/amd64
Experimental:      false

Server: Docker Engine - Community
Engine:
Version:          18.09.6
API version:      1.39 (minimum version 1.12)
Go version:       go1.10.8
Git commit:       481bc77
Built:            Sat May  4 01:59:36 2019
OS/Arch:          linux/amd64
Experimental:     false

███  DOCKSAL: PROJECTS
project             STATUS                    virtual host                                          project root
d8media             Up 42 minutes (healthy)   d8media.docksal,*.d8media.docksal,d8media.docksal.*   /home/andrew/web-projects/floss/d8media

███  DOCKSAL: VIRTUAL HOSTS
*.d8media.docksal
adminer.d8media.docksal
d8media.docksal.*
d8media.docksal

███  DOCKSAL: DNS
Successfully requested http://dns-test.docksal

███  DOCKER: RUNNING CONTAINERS
CONTAINER ID        IMAGE                     COMMAND                  CREATED             STATUS                    PORTS                                                    NAMES
6d3514a0ef68        adminer                   "entrypoint.sh docke…"   37 minutes ago      Up 37 minutes             8080/tcp                                                 d8media_adminer_1
0157e4384d8d        docksal/apache:2.4-2.3    "httpd-foreground"       42 minutes ago      Up 42 minutes (healthy)   80/tcp, 443/tcp                                          d8media_web_1
73fa6af8258a        docksal/cli:2.6-php7.2    "/opt/startup.sh sup…"   42 minutes ago      Up 37 minutes (healthy)   22/tcp, 3000/tcp, 9000/tcp                               d8media_cli_1
8b11eda0578c        docksal/mysql:5.6-1.4     "docker-entrypoint.s…"   42 minutes ago      Up 42 minutes (healthy)   0.0.0.0:32768->3306/tcp                                  d8media_db_1
b65701ced8cc        docksal/ssh-agent:1.2     "docker-entrypoint.s…"   8 days ago          Up 2 hours (healthy)                                                               docksal-ssh-agent
381fda0ef946        docksal/dns:1.1           "docker-entrypoint.s…"   8 days ago          Up 2 hours (healthy)      192.168.64.100:53->53/udp                                docksal-dns
e286cbc3168f        docksal/vhost-proxy:1.5   "docker-entrypoint.s…"   8 days ago          Up 2 hours (healthy)      192.168.64.100:80->80/tcp, 192.168.64.100:443->443/tcp   docksal-vhost-proxy

███  DOCKER: NETWORKS
NETWORK ID          NAME                DRIVER              SCOPE
9325dee680fd        _default            bridge              local
5ad5370a1f70        *CENSORED PROJECT NAME*_default     bridge              local
998d7c185f4a        bridge              bridge              local
adc9a165fd9f        d8media_default     bridge              local
49bdb758a45e        host                host                local
bef1cf7305a3        none                null                local
c03b048a9d89        umami_default       bridge              local

███  VIRTUALBOX
EXPECTED VERSION: 5.2.26
6.0.6_Ubuntur129722

███  HDD Usage
Filesystem                    Size  Used Avail Use% Mounted on
udev                           12G     0   12G   0% /dev
tmpfs                         2.4G  2.0M  2.4G   1% /run
/dev/mapper/kubuntu--vg-root  232G  201G   19G  92% /
tmpfs                          12G  396M   12G   4% /dev/shm
tmpfs                         5.0M  4.0K  5.0M   1% /run/lock
tmpfs                          12G     0   12G   0% /sys/fs/cgroup
/dev/sda2                     705M  165M  489M  26% /boot
/dev/sda1                     511M  7.7M  504M   2% /boot/efi
tmpfs                         2.4G   12K  2.4G   1% /run/user/1000

@achekulaev achekulaev self-assigned this May 23, 2019
@achekulaev achekulaev added this to To do in Docksal 1.12.2 via automation May 23, 2019
@achekulaev
Copy link
Member

achekulaev commented May 23, 2019

  1. It has already been fixed in development version

  2. I need to add this to cleanup to get read of leftovers

docker ps -a | grep "docksal/empty" | awk '{print $1}' | xargs docker rm

@fuzzbomb
Copy link
Contributor Author

Thanks. I thought it would be something as simple as the -rm fix.

@lmakarov
Copy link
Member

lmakarov commented Jun 1, 2019

Fixed via #1039

@lmakarov lmakarov closed this as completed Jun 1, 2019
Docksal 1.12.2 automation moved this from To do to Done Jun 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

No branches or pull requests

3 participants