Closed kwypchlo closed 3 years ago
So, we need a second container, alongside the main production container that the portal is going to be using. This second container should have the dev tools needed to build siad
and the source code. This part is easy and straightforward.
The debug container should be able to build siac
and siad
binaries which, crucially, should be used by the main production container after it's restarted. No problem there but there are some considerations.
The way to do it:
/usr/bin
, so when the container is restarted and tries to execute siad
from the PATH it will run the version from the volumesiac
and siad
and copy them to the volume and then restart the production containerConsiderations:
@kwypchlo your proposal can definitely work. I actually like it more than mine. Let's do that.
Due to debugging constraints when working with a pre-compiled binaries we should provide a dev image that:
/bin/bash
shell (compared to limited/bin/ash
from alpine)make
to recompile the binaries and restart a container (needs full go environment)siac
andsiad
after you recompile the binaries withmake
The idea is to be able to debug production servers like this:
docker stop sia
to stop the sia containerdocker-compose.yml
todev
docker exec -it sia /bin/bash
to ssh to sia container~/Sia
git directory where the master is checked outmake
to compile binariesexit
to exit sia container shelldocker restart sia
to restart sia container with your changes on it