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

Tierpsy Docker: investigate whether it is possible to set some of the environment variables in the Dockerfile instead of in the command #11

Open
taylorreiter opened this issue Sep 20, 2024 · 0 comments

Comments

@taylorreiter
Copy link
Member

In the snakefile tierpsy command, I'm currently specifying a lot of Docker env variables

rule run_tierpsy_tracker:
    ...
    shell:
        """
        docker exec -u root \
            -e SHELL=/bin/bash \
            -e HOME=/home/tierpsy_user \
            -e PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/tierpsy_user/.local/bin \
            -e TERM=xterm \
            -e PWD=/DATA \
            -e SHLVL=1 \
            -e LIBGL_ALWAYS_INDIRECT=1 \
            -e DOCKER_HOME=/home/tierpsy_user \
            -e _=/usr/bin/env \
            my_tierpsy_container \
            /bin/bash -c "umask 000; tierpsy_process --video_dir_root local_drive/{params.input_dir} --json_file local_drive/{input.config} --mask_dir_root local_drive/{params.mask_dir} --pattern_include *.mov --results_dir_root local_drive/{params.results_dir}"
        """

In #6, @keithchev asked:

Is it possible to set some of these env vars in the dockerfile instead? That would de-clutter the snakefile a bit (and clarify which env vars don't need to be specific to this docker exec command).

I'm not sure if this is possible. The container runs fine if i launch it not as a background process and has all of these variables set, it's only as root that they aren't set, so I'm not sure how to control that in the Dockerfile.

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

No branches or pull requests

1 participant