semaphore: Login fails when using the docker image

Using the below basic docker compose ansible semaphore is up but I get ‘Incorrect login or password’ when I try to login using adminuser/adminpassword

When I try to debug and run commands like semaphore user list this doesn’t work because I’m running semaphore using docker and these commands are not documented for the docker installation.

I tried to check the Dockerfile of semaphore but is not clear how to run adhoc commands since it uses ENTRYPOINT [“/sbin/tini”, “–”] and wrappers like /usr/local/bin/semaphore-wrapper so it is not straightforward to understand how to execute a simple command like semaphore user list

Please document how adhoc commands should be executed on the docker image.


services:

  semaphore:
    container_name: semaphore
    image: semaphoreui/semaphore:latest
    environment:
      SEMAPHORE_DB_DIALECT: bolt
      SEMAPHORE_PLAYBOOK_PATH: /home/infraworker/run/automations/conf-manag/ansible
      SEMAPHORE_ADMIN: adminuser
      SEMAPHORE_ADMIN_NAME: Admin
      SEMAPHORE_ADMIN_PASSWORD: adminpassword
      SEMAPHORE_ADMIN_EMAIL: admin@localhost
    volumes:
      - /home/infraworker/apps/cvs/custom-semaphore/config:/etc/semaphore
      - /home/infraworker/apps/cvs/custom-semaphore/data-boltdb:/var/lib/semaphore # database.boltdb location (Not required if using mysql or postgres)
    restart: unless-stopped
    networks:
      - bridge_current_host_cross_containers_net

networks:
  bridge_current_host_cross_containers_net:
    driver: bridge
    external: true

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 19 (5 by maintainers)

Most upvoted comments

I checked again by first deleting the database. Yes, you can set any password. Apparently the problem was that the first time it was started with SEMAPHORE_ADMIN_PASSWORD: changeme.

The environment variables are only used on the first start of semaphore.

It would be nice to add this comment to the docker-compose examples, if not already. Or even rename the variables to something like SEMAPHORE_INITIAL_ADMIN_PASSWORD to better reflect their behavior.

Try with boltdb with environment in docker-compose.yml like this

environment: SEMAPHORE_DB_DIALECT: bolt SEMAPHORE_PLAYBOOK_PATH: /home/infraworker/run/automations/conf-manag/ansible SEMAPHORE_ADMIN: adminuser SEMAPHORE_ADMIN_NAME: Admin SEMAPHORE_ADMIN_PASSWORD: adminpassword SEMAPHORE_ADMIN_EMAIL: admin@localhost

and do not declare admin user in config.json, start semaphore and then try to login with the admin user declared in docker-compose.yml

another thing is that I added

SEMAPHORE_PLAYBOOK_PATH: /home/infraworker/run/automations/conf-manag/ansible

but it does not seem to be taken into account either - after login (admin added with cmd line) I cannot see any inventory declared and, further more, when I try to manually add the local inventory I am not allowed because it asks for an Access Key which I am not allowed to enter.