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

README: Add Docker pull installation method #79

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

FabioCanavarro
Copy link
Contributor

@FabioCanavarro FabioCanavarro commented Feb 5, 2025

Fixes #71

This PR adds a new installation method for Bifrost using pre-built Docker images.

Changes

  • Updated installation methods list to include Docker Pull option
  • Added comprehensive Docker Pull section in README
  • Included platform-specific Docker pull commands
  • Provided guidance on running the Docker image with a local configuration file
  • Split the docker installation methods into its own file

@rohankapoorcom
Copy link

One suggestion I would make - add an example docker-compose config as well.

@FabioCanavarro
Copy link
Contributor Author

FabioCanavarro commented Feb 5, 2025

Hmmm, alright, I see, I will edit the pull request later in the afternoon

@rohankapoorcom
Copy link

Overall I think this is a great set of instructions to add, just the docker compose instructions make it even easier to configure. One page I think that shows an amazing set of docker installation instructions is Zigbee 2 MQTT: https://www.zigbee2mqtt.io/guide/installation/02_docker.html#docker-compose if you want something to reference.

@FabioCanavarro
Copy link
Contributor Author

I agree, and also I wish to thank you for making my life easier, I will try checking it out 😁

@FabioCanavarro
Copy link
Contributor Author

FabioCanavarro commented Feb 7, 2025

@rohankapoorcom to double check what you have meant, instead of docker pull, I edit the readme.md file to only include docker compose up -d, from the docker-compose.yml itself? (As I am quite not sure if the original issue wanted me to add docker pull also)

  1. Create a docker-compose.yml file with the following content:
version: '3.8'
services:
  bifrost:
    image: ghcr.io/chrivers/bifrost:master-2025-02-04
    container_name: bifrost
    restart: unless-stopped
    network_mode: host  # Required for mDNS discovery
    volumes:
      - ./config.yaml:/app/config.yaml
      - ./certs:/app/certs  # Certificate storage
    environment:
      - TZ=Europe/Copenhagen  # Set your timezone
 
2. Curl and rename the example configuration file:

```sh
curl -O https://raw.githubusercontent.com/chrivers/bifrost/master/config.example.yaml
cp config.example.yaml config.yaml
  1. Start the container:
docker compose up -d

is it something like this? (Feel free to point my mistakes, as I haven't really touched docker much)

@danieledwardgeorgehitchcock
Copy link

danieledwardgeorgehitchcock commented Feb 8, 2025

If you are willing to sacrifice mDNS discovery in favour of a more isolated Docker network, you can do the following:

docker-compose.yaml:

services:
  bifrost:
    image: ghcr.io/chrivers/bifrost:latest
    container_name: bifrost
    restart: unless-stopped
    networks:
      - home-automation # Docker Compose Defined Network (See Below Networks Section)
    volumes:
      - type: bind # Would Be Great For The Config File To Be In A Separate Directory, And Generated If Missing, Then We Could Use A Docker Volume For This
        source: ./bifrost/config.yaml
        target: /app/config.yaml
      - type: volume # Docker Compose Defined Volume (See Below Volumes Section)
        source: bifrost-certs
        target: /app/certs
    depends_on: # Not Necessarily Needed, But Good To Have When Controlling Service Startup On Boot
      zigbee2mqtt:
        condition: service_started
    ports:
      - 80:80/tcp
      - 443:443/tcp

volumes:
  bifrost-certs:

networks:
  home-automation:
    driver: bridge

config.yaml:

bifrost:
  cert_file: certs/cert.pem
bridge:
  name: Bifrost
  mac: 00:11:22:33:44:55 # Docker Container MAC
  ipaddress: 172.21.0.6 # Docker Container IP
  netmask: 255.255.255.0
  gateway: 172.21.0.1 # Docker Network Gateway
  timezone: Europe/London
z2m:
  zigbee2mqtt:
    url: ws://zigbee2mqtt:8080/api?token=ABC123 # If Your Z2M Instance Is Bound To The Same Docker Network As Bifrost, You Can Use The Container Name

@chrivers
Copy link
Owner

chrivers commented Feb 8, 2025

without mDNS discovery, am I correct in assuming the hue app will stop working?

If so, we should probably make that very clear. I'd prefer not to have more people frustrated and confused about connection problems :)

@chrivers
Copy link
Owner

chrivers commented Feb 8, 2025

@FabioCanavarro thank you for your contribution! I'll take a look 👍

@danieledwardgeorgehitchcock

without mDNS discovery, am I correct in assuming the hue app will stop working?

If so, we should probably make that very clear. I'd prefer not to have more people frustrated and confused about connection problems :)

It'll work, but the process in the app isn't as straightforward.. you have to click on "I need help" then "Manually add IP"

@rohankapoorcom
Copy link

without mDNS discovery, am I correct in assuming the hue app will stop working?

No, the hue app let's you manually specify the IP address of the bridge instead. But some other devices won't find the hue bridge that way (for example Harmony Hub).

I believe both Docker Compose examples look good!

Copy link
Owner

@chrivers chrivers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good - a couple of things to fix, but on the right path for sure. Thank you for submitting this :)

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@FabioCanavarro
Copy link
Contributor Author

My bad, had an exam at school, i will start updating it

…cument, erased the specific Arch pull method
If you want to put your configuration file or the certificates Bifrost creates somewhere
else, you also need to adjust the mount paths in the `docker-compose.yaml`. Otherwise,
just leave the default values.
- [Install using Docker Compose](doc/docker-.md) (recommended for most users)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something seems to be wrong with the link. docker-.md? 😃

Pull the latest image from Github Container Registry:

```sh
docker pull ghcr.io/chrivers/bifrost:master-2025-02-04
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:master-2025-02-04 may or may not be the latest release right now, but it's not always going to be.

But the :latest tag (also the default, if no tag is specified) always points to the latest stable release.

So since we're specifically saying "pull the latest release", we should say

docker pull ghcr.io/chrivers/bifrost

We could then mention that specific releases are available, with tags such as "master-2025-02-04". By using it as an example of the concept, rather than the example of how to install, it's more clear that there are other versions available 👍

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest making the :latest tag explicit rather than implicit.

Comment on lines +25 to +26
To view the logs, use a tool like [Portainer](https://www.portainer.io/) or
run the following command:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know you just copied this from the old description, but I only realize now that portainer.io is a commercial thing. I'm not going to recommend it in my open source project, so please remove any references to that.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Portainer Community Edition is open source :) https://github.com/portainer/portainer

Now run the Docker Container:

```sh
docker run -v $(pwd)/config.yaml:/app/config.yaml ghcr.io/chrivers/bifrost:master-2025-02-04
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also remove the tag here :)

```sh
docker logs bifrost
```
Choose the method that best fits your needs.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this line ("Choose the.."), and instead make the headline above the two options more decisive. Something like "Please choose one of the following installation methods:".

Copy link
Owner

@chrivers chrivers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FabioCanavarro thanks for updating it!

Don't worry about the delay - exams are important, and we all have a real life to take care of outside of github :)

I have a few more changes, but then I think we're good 👍

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

Successfully merging this pull request may close these issues.

Make docker download clearer (was: Publish Image To Docker Registry)
4 participants