Does the generic Linux install work with Podman installed instead of Docker-CE?

If no one has tried it yet I will (eventually). I’m going to guess it won’t work because the supervisor is probably tightly integrated with the docker daemon, but maybe it will be enough to alias docker=podman.

Does not seem to be that easy as Hassio-supervisor relies on docker sockets to talk to the daemon as you said. At least that’s what I saw after a quick research. Would be great to have Podman support, but I guess that would require extensive redesign.

Yep, I gave it a shot and it didn’t work for exactly that reason. Coincidentally I was looking into this again the other day. I’d be interested in attempting a refactor to make it work with Podman but I’d be doing a lot of guessing about how to properly replace the docker socket functionality.

I’ve installed it today using podman on Fedora 31 (virtualized in proxmox). Everything went fine, the instance seems to be working normally. I wouldn’t give it a second thought, however, now I started looking through everything and wondering where did the add-ons go…

Did I understand this correctly - hassio is orchestrating the docker daemon from inside its own container? Wouldn’t it make more sense to run docker in docker for a purpose like this? At the first glance, it would make for a more compatible setup that does not rely on the host virtualization/containerization.

I’d love to take a stab at this, but with the current time constraints, might never happen.

BTW Great thing to be running it as a normal, unprivileged user with SELinux enforcing. Really clean setup, too bad it’s not fully functional.

PS Also really a pity that docker doesn’t work on latest Fedora unless you switch to cgroups v1 (haven’t tried and I’d rather install a CentOS 7 VM for this rather than to possibly break my playground).

If anybody would like to try this setup (it works, just no add-ons) here’s a simplified tutorial for Fedora Server.

  1. Install podman :sweat_smile: and set up the basics
    dnf -y install podman
    useradd hassio
    
  2. And as hassio user (su - hassio) in home directory set up the container
    mkdir config
    chcon -Rt svirt_sandbox_file_t config # this is needed only if selinux is enforcing
    podman run -d -v /home/hassio/config:/config --name hassio --net=host  homeassistant/home-assistant:stable
    
  3. Go back to root and setup a systemd service to ensure we’re up after reboot or failure.
    Create /etc/systemd/system/hassio.service file the following contents:
    [Unit]
    Description=Home Assistant @ Podman
    
    [Service]
    Restart=on-failure
    RestartSec=10
    User=hassio
    Group=hassio
    WorkingDirectory=/home/hassio
    ExecStart=/usr/bin/podman start -a hassio
    ExecStop=/usr/bin/podman stop -t 2 hassio
    ExecStartPre=/usr/bin/chcon -Rt svirt_sandbox_file_t /home/hassio/config
    
    [Install]
    WantedBy=local.target
    

This isn’t hassio. It’s just home assistant running in a container.

1 Like

Anyone happen to try hassio with podman by aliasing docker to podman?

Yes and it didn’t work for the reasons I stated above.

The new version of libpod includes a Docker compatible API podman system service.
It isn’t production ready yet. Maybe someone could try if it works with hass.io

I tried if it works with libpod 1.8.0

ln -s /usr/bin/podman /usr/bin/docker
cat > /etc/systemd/system/docker.service << EOF
[Unit]
Description=Podman Docker compatible API

[Service]
Type=simple
Restart=always
RestartSec=1
ExecStart=/usr/bin/podman system service -t 0 unix:///var/run/docker.sock

[Install]
WantedBy=multi-user.target
EOF
systemctl enable docker.service 
systemctl start docker.service
service docker start
curl -sL "https://raw.githubusercontent.com/home-assistant/hassio-installer/master/hassio_install.sh" | bash -s

The output:

[Info] Install supervisor Docker container
Trying to pull docker.io/homeassistant/amd64-hassio-supervisor:201...
Getting image source signatures
Copying blob 70ba533d906a skipped: already exists  
Copying blob c9b1b535fdd9 skipped: already exists  
Copying blob 4c0d7af80934 skipped: already exists  
Copying blob 4d91f7f19f36 skipped: already exists  
Copying blob bdd90015b1d9 skipped: already exists  
Copying blob 401afae7b2b5 skipped: already exists  
Copying blob 94837e2aa54b skipped: already exists  
Copying blob a92516be43f6 skipped: already exists  
Copying blob 79c7cd071f69 skipped: already exists  
Copying blob 1c49dd135bd3 skipped: already exists  
Copying blob 0c54307379e2 skipped: already exists  
Copying blob 9f2c65110161 skipped: already exists  
Copying config 11968a808a done  
Writing manifest to image destination
Storing signatures
[Info] Install supervisor startup scripts
[Info] Install AppArmor scripts
[Info] Run Hass.io

Am I doing something wrong? Never tried it with Docker, so no idea what it looks like with real Docker.

No errors, but also no containers running :frowning:

EDIT:

Logs from the supervisor container

# podman logs hassio_supervisor
20-02-23 20:51:21 INFO (MainThread) [__main__] Initialize Hass.io setup
20-02-23 20:51:21 INFO (MainThread) [hassio.docker.network] Can't find Hass.io network, create new network
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/docker/api/client.py", line 261, in _raise_for_status
    response.raise_for_status()
  File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http+docker://localhost/v1.40/networks/create

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/src/hassio/hassio/__main__.py", line 41, in <module>
    coresys = loop.run_until_complete(bootstrap.initialize_coresys())
  File "uvloop/loop.pyx", line 1456, in uvloop.loop.Loop.run_until_complete
  File "/usr/src/hassio/hassio/bootstrap.py", line 44, in initialize_coresys
    coresys = CoreSys()
  File "/usr/src/hassio/hassio/coresys.py", line 54, in __init__
    self._docker: DockerAPI = DockerAPI()
  File "/usr/src/hassio/hassio/docker/__init__.py", line 36, in __init__
    self.network: DockerNetwork = DockerNetwork(self.docker)
  File "/usr/src/hassio/hassio/docker/network.py", line 24, in __init__
    self.network: docker.models.networks.Network = self._get_network()
  File "/usr/src/hassio/hassio/docker/network.py", line 71, in _get_network
    options={"com.docker.network.bridge.name": DOCKER_NETWORK},
  File "/usr/local/lib/python3.7/site-packages/docker/models/networks.py", line 154, in create
    resp = self.client.api.create_network(name, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/docker/api/network.py", line 153, in create_network
    return self._result(res, json=True)
  File "/usr/local/lib/python3.7/site-packages/docker/api/client.py", line 267, in _result
    self._raise_for_status(response)
  File "/usr/local/lib/python3.7/site-packages/docker/api/client.py", line 263, in _raise_for_status
    raise create_api_error_from_http_exception(e)
  File "/usr/local/lib/python3.7/site-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation)
docker.errors.NotFound: 404 Client Error: Not Found ("b'Not Found'")
20-02-23 20:51:21 ERROR (MainThread) [asyncio] Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7feace387650>
20-02-23 20:51:21 ERROR (MainThread) [asyncio] Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7feace332a90>
1 Like