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

Enter the workspace container: aliases.sh syntax error #2745

Closed
medvem opened this issue Oct 17, 2020 · 2 comments
Closed

Enter the workspace container: aliases.sh syntax error #2745

medvem opened this issue Oct 17, 2020 · 2 comments

Comments

@medvem
Copy link
Contributor

medvem commented Oct 17, 2020

Description:

When I enter to the workspace container, I get this error:

$ winpty docker-compose exec workspace bash
bash: $'\r': command not found
bash: $'\r': command not found
bash: /root/aliases.sh: line 119: syntax error near unexpected token `$'{\r''
'ash: /root/aliases.sh: line 119: `function mkd() {

Expected Behavior:

No error :-)

Context information:

Output of git rev-parse HEAD

89c9cfe09941bead05d63ec3c0fe9b9173ce0526

Output of docker version

Client: Docker Engine - Community
 Cloud integration  0.1.18
 Version:           19.03.13
 API version:       1.40
 Go version:        go1.13.15
 Git commit:        4484c46d9d
 Built:             Wed Sep 16 17:00:27 2020
 OS/Arch:           windows/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.13
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       4484c46d9d
  Built:            Wed Sep 16 17:07:04 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.3.7
  GitCommit:        8fba4e9a7d01810a393d5d25a3621dc101981175
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Output of docker-compose version

docker-compose version 1.27.4, build 40524192
docker-py version: 4.3.1
CPython version: 3.7.4
OpenSSL version: OpenSSL 1.1.1c  28 May 2019

System info: Mac, Windows or Linux. Include which disto/version

Windows 10 Pro, build 19041.572

Steps to reproduce the issue:

  1. docker-compose up -d nginx mysql workspace phpmyadmin
  2. winpty docker-compose exec workspace bash

Stacktrace & Additional info:

All files are unmodified.

@xsepption
Copy link

Have the same issue. This is somehow related to windows line endings (CRLF) in aliases.sh. After manually changing CRLF to LF in aliases.sh and rebuilding and restarting the workspace container, the issue disappeared. CRLF in *.sh files is never a good thing. Why don't we add a .gitattributes file to the repo, so we could control that all *.sh files are checked out with LF, regardless of the local settings on user side. Following configuration could the trick:

*.sh text eol=lf

@medvem
Copy link
Contributor Author

medvem commented Nov 7, 2020

@xsepption Thanks! It's worked for me.

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

No branches or pull requests

2 participants