mintproject / mic

Model Insertion Checker
https://mic-cli.readthedocs.io/en/latest/
5 stars 3 forks source link

MIC is not working in WINDOWS #266

Closed dgarijo closed 4 years ago

dgarijo commented 4 years ago

The latest version of mic (both 1.2.1 and develop) are not working in WINDOWS:

After doing: mic encapsulate start the program asks for my component name, downloads the image and then exists:


 ---> Running in c195b4142723
 ---> df7a18f5d0f5
Successfully built df7a18f5d0f5
Successfully tagged example:latest

You are in a Linux environment Debian distribution
We detect the following dependencies.

- If you install new dependencies using `apt` or `apt-get`, remember to add them in Dockerfile mic\docker\Dockerfile
- If you install new dependencies using python. Before the step `upload` run

pip freeze > mic/docker/requirements.txt

Please, run your Model Component.
docker run --rm -ti         --cap-add=SYS_PTRACE         -v C:\Users\dgarijo\Desktop\192\java_model_clean:/tmp/mint         -w /tmp/mint example:latest
standard_init_linux.go:211: exec user process caused "no such file or directory"

Version 1.2.0 (installed from pypi) does not have this issue.

issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.92. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

mosoriob commented 4 years ago

Windows is writing the file using CRLF breaking line

CR and LF are control characters, respectively coded 0x0D (13 decimal) and 0x0A (10 decimal). They are used to mark a line break in a text file. As you indicated, Windows uses two characters the CR LF sequence; Unix only uses LF and the old MacOS ( pre-OSX MacIntosh) used CR.

https://futurestud.io/tutorials/how-to-fix-exec-user-process-caused-no-such-file-or-directory-in-docker

Before coding, I recommend checking if mic is writing the files using CRLF

  1. Generate a new project
  2. Check the format of each file. Especially the Dockerfile. a. If the encoding is LF, open the file and verify the encoding
dgarijo commented 4 years ago

I checked and all files are written with CRLF: In /docker:

Dockerfile:    ASCII text, with CRLF line terminators
entrypoint.sh: Bourne-Again shell script, ASCII text executable, with CRLF line terminators

in /mic:

data:     directory
docker:   directory
mic.yaml: ASCII text, with CRLF line terminators
src:      directory