6

I'm installing Gitlab on my server using docker-compose based on Docker Docs. My SSH port is not the default one (22) and I have changed it to something else like 2228. So the YML file became like this:

web:
  image: 'gitlab/gitlab-ce:latest'
  restart: always
  hostname: 'gitlab.mydomain.com'
  environment:
    GITLAB_OMNIBUS_CONFIG: |
      external_url 'https://gitlab.mydomain.com'
      gitlab_rails['gitlab_shell_ssh_port'] = 2228
  ports:
    - '80:80'
    - '443:443'
    - '2228:22'
  volumes:
    - '/srv/gitlab/config:/etc/gitlab'
    - '/srv/gitlab/logs:/var/log/gitlab'
    - '/srv/gitlab/data:/var/opt/gitlab'

When I run the docker-compose up -d, I receive this result and errors:

Starting docker_web_1 ...

ERROR: for docker_web_1 a bytes-like object is required, not 'str'

ERROR: for web a bytes-like object is required, not 'str' Traceback (most recent call last): File "site-packages/docker/api/client.py", line 261, in _raise_for_status File "site-packages/requests/models.py", line 940, in raise_for_status requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http+docker://localhost/v1.21/containers/9d4483106cf1683f46b5158a9550f9b4375d7c147ecb8b07df533840ad0806b6/start

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "compose/service.py", line 625, in start_container File "compose/container.py", line 241, in start File "site-packages/docker/utils/decorators.py", line 19, in wrapped File "site-packages/docker/api/container.py", line 1095, in start File "site-packages/docker/api/client.py", line 263, in _raise_for_status File "site-packages/docker/errors.py", line 31, in create_api_error_from_http_exception docker.errors.APIError: 500 Server Error: Internal Server Error ("b'driver failed programming external connectivity on endpoint docker_web_1 (9b32d28cc2f635e085e82a2ef9f4d1fd3afc76f7693e279405ada5f61b96d215): Error starting userland proxy: listen tcp 0.0.0.0:443: bind: address already in use'")

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "bin/docker-compose", line 6, in <module> File "compose/cli/main.py", line 72, in main File "compose/cli/main.py", line 128, in perform_command File "compose/cli/main.py", line 1107, in up File "compose/cli/main.py", line 1103, in up File "compose/project.py", line 570, in up File "compose/parallel.py", line 112, in parallel_execute File "compose/parallel.py", line 210, in producer File "compose/project.py", line 556, in do File "compose/service.py", line 568, in execute_convergence_plan File "compose/service.py", line 510, in _execute_convergence_start File "compose/parallel.py", line 112, in parallel_execute File "compose/parallel.py", line 210, in producer File "compose/service.py", line 508, in <lambda> File "compose/service.py", line 620, in start_container_if_stopped File "compose/service.py", line 627, in start_container TypeError: a bytes-like object is required, not 'str' [5738] Failed to execute script docker-compose

I'm new in Docker and docker-compose, but I did everything as it is written in the official documentation. May you help me plesae to solve this issue?

Mohammad Saberi
  • 161
  • 1
  • 2
  • 1
    listen tcp 0.0.0.0:443: bind: address already in use It seems that the 443 port on your system is not available. Please check whether this port is available before starting these docker images or choose another port. – 030 Dec 07 '19 at 10:42
  • why would this prevent building the image? I can see that it would impact running a container. – Nicholas Saunders Sep 24 '20 at 19:56

1 Answers1

4

In the error message you presented your system is reporting port 443 is already in use. You need to confirm which ports you have in use for other services.

listen tcp 0.0.0.0:443: bind: address already in use

For what it is worth I recommend you use a nginx reverse proxy. Please reference https://stackoverflow.com/questions/46195852/how-to-run-gitlab-in-docker-container-with-nginx-proxy-over-ssl-with-letsencrypt for further details.

Steven K7FAQ
  • 666
  • 1
  • 5
  • 13