Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix no-user-in-docker-container-when-using---build-template-condapixiv1 #974

Open
munishchouhan wants to merge 2 commits intomaster from
973-no-user-in-docker-container-when-using---build-template-condapixiv1
Open

Fix no-user-in-docker-container-when-using---build-template-condapixiv1 #974
munishchouhan wants to merge 2 commits intomaster from
973-no-user-in-docker-container-when-using---build-template-condapixiv1

Conversation

@munishchouhan
Copy link
Member

@munishchouhan munishchouhan commented Jan 28, 2026

closes #973

Problem

Python's getpass.getuser() was raising OSError: No username set in the environment when running in containers built with the pixi template, but worked fine with the
micromamba template.

Root Cause

The pixi template didn't set the USER environment variable in the final container stage, while Python's getpass.getuser() function requires one of these environment
variables to be present: LOGNAME, USER, LNAME, or USERNAME.

Solution

Updated the pixi Dockerfile template (src/main/resources/templates/conda-pixi-v1/dockerfile-conda-file.txt) to match the micromamba v2 template behavior by adding:

  • USER root directive
  • ENV USER=root environment variable

This ensures Python applications can successfully call getpass.getuser() without errors.

Changes

  • Modified conda-pixi-v1/dockerfile-conda-file.txt to add USER and ENV directives
  • Updated all pixi-related tests in TemplateUtilsTest and ContainerHelperTest to reflect the new template output

Signed-off-by: munishchouhan <hrma017@gmail.com>
Copy link
Member Author

tested locally with the reprocuder:
#973 (comment)

container: docker.io/hrma017/python_pip_drevalpy:5a2ddde782d035e0

% nextflow run test_container.nf -c docker-user.config
 N E X T F L O W ~ version 25.11.1-edge
Launching `test_container.nf` [desperate_lamport] DSL2 - revision: cc774c8f10
executor > local (1)
[31/87ea03] TEST_PYTHON_CONTAINER [100%] 1 of 1 ✔
Completed at: 10-Feb-2026 10:08:11
Duration : 7m 4s
CPU hours : 0.1
Succeeded : 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@pditommaso pditommaso Awaiting requested review from pditommaso

@cristianrcv cristianrcv Awaiting requested review from cristianrcv

@fntlnz fntlnz Awaiting requested review from fntlnz

At least 1 approving review is required to merge this pull request.

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

No user in docker container when using --build-template conda/pixi:v1

1 participant

Comments

AltStyle によって変換されたページ (->オリジナル) /