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

Client configuration does not use COMPUTERNAME at all #2

Open
bkraul opened this issue Nov 26, 2019 · 4 comments
Open

Client configuration does not use COMPUTERNAME at all #2

bkraul opened this issue Nov 26, 2019 · 4 comments

Comments

@bkraul
Copy link

bkraul commented Nov 26, 2019

I used to install the urbackup client on the actual host, but I am trying to do it through a container now. I am putting the client on the same compose stack as the server, using the proper mounts, and a network between the two.

The server is seeing the clients, and the backups works. Everything works, really, except the fact that every time the stack is destroyed and recreated, the client uses a new, random-generated name, therefore, I end up with endless backups of the same thing:

image
image

Here is my docker-compose:

version: '2.4'
services:
  urbackup:
    image: uroni/urbackup-server
    restart: always
    ports:
      - '55415:55415'
      - '35623:35623/udp'
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ~/docker-persist/urbackup/database:/var/urbackup
      - ~/backup:/backups
    environment:
      - VIRTUAL_HOST=urbackup.mydomain.com
      - VIRTUAL_PORT=55414
      - HTTPS_METHOD=noredirect
    networks:
      - reverse-proxy
      - default
  urbackup-client:
    image: hejare/urbackup-client
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /srv/dev-disk-by-label-NAS:/backup/nas:ro
    environment:
      - COMPUTERNAME=nas
    networks:
      - default

networks:
  reverse-proxy:
    external:
      name: reverse-proxy

As you can see, there is no need to declare the ports for the client, because it is in the same default network as the client.

It would be great if it could actually use the same name/identifier, even after recreate.

@henriksvensson
Copy link
Contributor

Thank you for your input. If you have a PR for the solution, I'm happy to look at that, otherwise I'll do some investigation on my own when I get the time.

@fotoklaasje
Copy link

I ran into the same problem, and adding the --hostname my_desired_hostname as a docker parameter solved it for me

@bkraul
Copy link
Author

bkraul commented May 15, 2020

Where did you add this? On each of the client container instances?

@fotoklaasje
Copy link

I added it as a parameter to the client, config below. I am not sure whether the COMPUTERNAME variable is required:

docker run -d --name='urbackup-client' --net='backup' -e TZ="Europe/Berlin" -e HOST_OS="Unraid" -e 'COMPUTERNAME'='My_Desired_Hostname' -v '/xyz/':'/backup/xyz/':'ro' --hostname My_Desired_Hostname 'hejare/urbackup-client'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants