The solution to the error prompt of docker-compose encountered when connecting to Linux

Problem Description

  • Sometimes, when we log in to linux, we may encounter such problems, prompting us docker-xomposethat there are some errors, as follows:
-bash: /etc/bash_completion.d/docker-compose: line 22: syntax error near unexpected token `$'{
     
     \r''
'bash: /etc/bash_completion.d/docker-compose: line 22: `__docker_compose_q() {
    
    

Cause Analysis

  • The docker-compose file format is incompatible, and there are hidden dangers: it may cause docker-composethe command to fail!
  • The newline character of the doc format file is different from that of the Unix format file, /etc/bash_completion.d/docker-composejust open and modify the file format according to the prompt

Solution

  • Using the MobaXterm software, open the file using the default editor
    insert image description here
  • Then select the file format
    insert image description here

Guess you like

Origin blog.csdn.net/yang2330648064/article/details/129870096