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

Wiki page for LDAP suggestion to use override conflicts with main docker-compose.yml #360

Closed
JonathonReinhart opened this issue Nov 4, 2020 · 3 comments
Labels
documentation An issue with the documentation or a request for more of it.

Comments

@JonathonReinhart
Copy link

Thanks for the nice integration! I'm setting up an LDAP instance and found a small gotcha:

Background

The main docker-compose.yml uses a YAML anchor and reference to specify the netbox-worker container:

services:
  netbox: &netbox
    # ...
  netbox-worker:
    <<: *netbox
    # ...

The current version of the LDAP wiki page suggests using a docker-compose.override.yml file which changes that image to the -ldap variant:

services:
  netbox:
    image: netboxcommunity/netbox:${VERSION-latest-ldap}
    # ...

Problem

The problem is this:

  1. The YAML anchor/reference in docker-compose.yml is evaluated first, effectively yielding this:
    services:
      netbox:
        image: netboxcommunity/netbox:latest
        # ...
      netbox:
        image: netboxcommunity/netbox:latest
        # ...
  2. The docker-compose.override.yml content is applied, effectively yielding this:
    services:
      netbox:
        image: netboxcommunity/netbox:latest-ldap
        # ...
      netbox:
        image: netboxcommunity/netbox:latest
        # ...

As you can see, this leads to a disconnect between the images used for the netbox and netbox-worker containers:

# docker-compose images
          Container                   Repository             Tag         Image Id       Size  
----------------------------------------------------------------------------------------------
netbox-docker_netbox-worker_1   netboxcommunity/netbox   latest        03f42c259997   220.9 MB
netbox-docker_netbox_1          netboxcommunity/netbox   latest-ldap   1749d1867724   225.9 MB
netbox-docker_nginx_1           nginx                    1.19-alpine   4efb29ff172a   21.81 MB
netbox-docker_postgres_1        postgres                 12-alpine     44c9a6a10db6   157.7 MB
netbox-docker_redis-cache_1     redis                    6-alpine      c1949ec48c51   31.15 MB
netbox-docker_redis_1           redis                    6-alpine      c1949ec48c51   31.15 MB

I haven't yet determined if this causes any problems, but it seems like undesired behavior.

Workaround

The workaround is simple, adding this to the suggested docker-compose.override.yml file:

  netbox-worker:
    image: netboxcommunity/netbox:${VERSION-latest-ldap}
# docker-compose images
          Container                   Repository             Tag         Image Id       Size  
----------------------------------------------------------------------------------------------
netbox-docker_netbox-worker_1   netboxcommunity/netbox   latest-ldap   1749d1867724   225.9 MB
netbox-docker_netbox_1          netboxcommunity/netbox   latest-ldap   1749d1867724   225.9 MB
netbox-docker_nginx_1           nginx                    1.19-alpine   4efb29ff172a   21.81 MB
netbox-docker_postgres_1        postgres                 12-alpine     44c9a6a10db6   157.7 MB
netbox-docker_redis-cache_1     redis                    6-alpine      c1949ec48c51   31.15 MB
netbox-docker_redis_1           redis                    6-alpine      c1949ec48c51   31.15 MB
@cimnine
Copy link
Collaborator

cimnine commented Nov 4, 2020

Thank you for bringing this to our attention. The wiki is open and can be edited by anyone. Feel free to adjust the page.

@cimnine cimnine added the documentation An issue with the documentation or a request for more of it. label Nov 4, 2020
@cimnine cimnine closed this as completed Nov 4, 2020
@JonathonReinhart
Copy link
Author

I've updated the Wiki page to add my better workaround:
https://github.com/netbox-community/netbox-docker/wiki/LDAP/4ed440cf1b0fac561636374c928262d6ab8e6287

@JonathonReinhart
Copy link
Author

Updated the Wiki page again to include netbox-housekeeping image:
https://github.com/netbox-community/netbox-docker/wiki/LDAP/cea452f3ffd2aa9aa63e4ba4116d314f4b91ae35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation An issue with the documentation or a request for more of it.
Projects
None yet
Development

No branches or pull requests

2 participants