cdrx / docker-pyinstaller

PyInstaller for Linux and Windows inside Docker
MIT License
617 stars 243 forks source link

OSError: [WinError 123] Invalid name: '/tmp\\*' #86

Open max-tet opened 4 years ago

max-tet commented 4 years ago

I am seeing this error when running docker-pyinstaller as part of a Gilab CI build script. When running it locally, it works without problems.

This is the CI job:

    stage: build_exec
    image: python:3.8-buster
    script:
        - apt update
        - apt -y install apt-transport-https ca-certificates curl gnupg2 software-properties-common
        - curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
        - add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
        - apt update
        - apt -y install docker-ce docker-ce-cli containerd.io
        - cd src/backend
        - pip install virtualenv
        - virtualenv --python=python3 venv
        - source venv/bin/activate
        - pip install .
        - pip freeze > requirements.txt
        - echo "$(pwd)"
        - ls
        - docker run -v "$(pwd):/src/" cdrx/pyinstaller-windows
    tags:
        - linux
        - dind
    artifacts:
        name: terminal_desktop_win
        paths:
            - src/backend/dist/windows/main.exe
        expire_in: 1d

The Gitlab runner is my own local dev machine and I configured it with volumes = ["/cache","/var/run/docker.sock:/var/run/docker.sock"], so the python:3.8-buster container should be able to use the docker socket and spin up the cdrx/pyinstaller-windows container as a sibling. Still, this is the result.

$ docker run -v "$(pwd):/src/" cdrx/pyinstaller-windows
537 INFO: PyInstaller: 3.6
538 INFO: Python: 3.7.5
538 INFO: Platform: Windows-7-6.1.7601-SP1
558 INFO: UPX is not available.
559 INFO: Removing temporary files and cleaning cache in C:\users\root\Application Data\pyinstaller
Traceback (most recent call last):
  File "c:\Python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\Python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python37\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
  File "c:\Python37\lib\site-packages\PyInstaller\__main__.py", line 114, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "c:\Python37\lib\site-packages\PyInstaller\__main__.py", line 65, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "c:\Python37\lib\site-packages\PyInstaller\building\build_main.py", line 734, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "c:\Python37\lib\site-packages\PyInstaller\building\build_main.py", line 636, in build
    os.makedirs(pth)
  File "c:\Python37\lib\os.py", line 221, in makedirs
    mkdir(name, mode)
OSError: [WinError 123] Invalid name: '/tmp\\*'

I made sure that the spec file is in the CWD as suggested in this ticket. I also tried adding :Z to the volume.

DanielKrolopp commented 4 years ago

I'm having the same issue, even when running this locally. I also have tried the the spec file as suggested in max-tet's ticket.

m0ngr31 commented 4 years ago

I had this same issue. Turns out it was mapping directories wrong. I had it running inside of another docker container and it needed the paths for the host directory, not the paths for the container.

pwyq commented 3 years ago

got same problem running on Windows and Ubuntu

nono313 commented 2 years ago

Any news on this issue ? I am getting the same with Docker Desktop on Windows 10

liyujun-dev commented 1 year ago

The same issue in https://github.com/JackMcKew/pyinstaller-action-windows/issues/3