Open spantaleev opened 3 years ago
I could easily add something to this like
Env = [ "PATH=${pkgs.matrix-registration.alembic}/bin/" ];
and maybe also add a symlink for the ini to /data? kinda wish i could just set two entrypoints for both alembic and mreg.
Hmm the other nix approach might be to make a wrapper, e.g. I use this:
{
matrix-registration-cli-wrapper = pkgs.stdenv.mkDerivation {
name = "matrix-registration-cli-wrapper";
buildInputs = [ pkgs.makeWrapper ];
buildCommand = ''
mkdir -p $out/bin
makeWrapper ${pkgs.matrix-registration}/bin/matrix-registration "$out/bin/matrix-registration" \
--add-flags "--config-path='${matrix-registration-config}'"
'';
};
}
if I put both configured like that on the PATH
I could just use a default entrypoint.
then I guess you would have to write out the entire command. as in matrix-registration serve
or alembic upgrade head
instead of just serve
, but overwriting the entrypoint for alembic seems kinda bad?
I'm not sure I understand what the above nix configuration does, but anyway.. writing out the entire command sounds (matrix-registration serve
, instead of just serve
) sounds good.
Because nix is used to build the container image, it's not easy to run alembic.
For
0.9.1
, thealembic
binary happens to be at/nix/store/lcbqvdllxb7lnrk85zq4pdl63yxdbb4z-python3.8-alembic-1.4.2/bin/alembic
. Seems like we need to set this as an--entrypoint
to invoke it.It appears that we also need to pass a config to it, which happens to live at
/nix/store/5q2rmk3i4cvjzb5x6s19s5gmv34gjpf6-python3.8-matrix-registration/alembic.ini
.Looks like we also need to run the
alembic
command with a working directory like/nix/store/5q2rmk3i4cvjzb5x6s19s5gmv34gjpf6-python3.8-matrix-registration
(passed todocker run
via-w
).In the end, I've gotten to a command like this:
Yet I still get some error like this:
So I'm guessing the command above needs even more work.
Is it possible to adjust the container-building script, so that it puts binaries (or symlinks to them) at a predictable path?
What would be the proper way to invoke
alembic
from a container image?Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1208