Install on Docker issue

So I’m preparing a docker container to run my Chia farmer… I pulled the current release of Ubuntu. No issues.
Spun up a container with following command:
docker run -d -t --expose=8444 --name=chia ubuntu
No problems there.
went into the container…
docker exec -it chia bash
Did a apt update&&apt upgrade -y
Added the chia repository, did apt update. No issues
installed the prerequisites and some utilities I use.
Installed chia-blockchain from git.
went to execute sh and got an error that sudo not found (I am logged on to the container as root(which is the default behaviour), so this may be the issue)
I edited the script and did a find and replace of all sudo commands. Saved it.Ran it. No issues.
executed . ./activate
ran chia keys add and put in my mnemonic. No issues.
Then I run a ‘chia start farmer’ and that’s where it goes sideways… Lots of errors and not sure if I should start to debug them all or try and logon as a regular non-root user and try again…
I checked version with ‘chia version’ and it returned ‘1.7.1.dev0’ Is this normal?

Alternative I see is that there’s a docker GitHub project I could pull but when I looked into it whoever uploaded it left their .chia directory intact and it has someone else’s keys and config there. It does run, so I could just with their .chia/ and go from there?

Any thoughts?


Startup errors:
(venv) root@43482e33ffe8:~/chia-blockchain# chia version
(venv) root@43482e33ffe8:~/chia-blockchain# chia start farmer
Daemon not started yet
Starting daemon
Traceback (most recent call last):
File “/root/chia-blockchain/venv/bin/chia”, line 8, in
File “/root/chia-blockchain/chia/cmds/”, line 131, in main
cli() # pylint: disable=no-value-for-parameter
File “/root/chia-blockchain/venv/lib/python3.10/site-packages/click/”, line 1130, in call
return self.main(*args, **kwargs)
File “/root/chia-blockchain/venv/lib/python3.10/site-packages/click/”, line 1055, in main
rv = self.invoke(ctx)
File “/root/chia-blockchain/venv/lib/python3.10/site-packages/click/”, line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/root/chia-blockchain/venv/lib/python3.10/site-packages/click/”, line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/root/chia-blockchain/venv/lib/python3.10/site-packages/click/”, line 760, in invoke
return __callback(*args, **kwargs)
File “/root/chia-blockchain/venv/lib/python3.10/site-packages/click/”, line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File “/root/chia-blockchain/chia/cmds/”, line 107, in run_daemon_cmd[“root_path”], wait_for_unlock=wait_for_unlock))
File “/usr/lib/python3.10/asyncio/”, line 44, in run
return loop.run_until_complete(main)
File “/usr/lib/python3.10/asyncio/”, line 646, in run_until_complete
return future.result()
File “/root/chia-blockchain/chia/daemon/”, line 1365, in async_run_daemon
await ws_server.start()
File “/root/chia-blockchain/chia/daemon/”, line 174, in start
self.webserver = await WebServer.create(
File “/root/chia-blockchain/chia/util/”, line 80, in create
await site.start()
File “/root/chia-blockchain/venv/lib/python3.10/site-packages/aiohttp/”, line 121, in start
self._server = await loop.create_server(
File “/usr/lib/python3.10/asyncio/”, line 1505, in create_server
raise OSError(err.errno, ‘error while attempting ’
OSError: [Errno 99] error while attempting to bind on address (’::1’, 55400, 0, 0): cannot assign requested address
Daemon not started yet
Failed to create the chia daemon

That is not how you use docker. Take a look at my repo: chia-docker/chia-docker at main · aarcro/chia-docker · GitHub (or go find the official one, we’ve drifted apart) Mine supports harvesters or full nodes, and a number of alts.

Thanks! I’m just getting started on Docker, so I’m still learning the concepts. Where am I going wrong in my thinking? I’ve just read today that doing apt updates isn’t really required in Docker containers…

It looks like you’re thinking of it like a VM. Where you get on there and run a bunch of stuff interactively. You shouldn’t be running updates, that should happen in the Dockerfile that builds the image. By they time you’re running a container it should just be fire and forget.

If you peek at my repo there, you’ll find a dockerfile that builds on the latest ubuntu image, fixes the sudo issue, installs the required system packages, and the chia software (it’s the foxypool branch with their og-pooling code by default, but you can change it back easily enough).

Remember that anything you do in a docker run goes away completely when you close it. So launching ubuntu and installing everything interactively is not at all sustainable - you’re doing that all again after the power goes out.