//Runs android sdk on container
docker run -it — rm -v $(pwd)/sdk:/sdk thyrlian/android-sdk bash -c 'cp -a $ANDROID_HOME/. /sdk'
Throws below error
docker: invalid reference format.
See 'docker run --help'.
//Runs android sdk on container
docker run -it — rm -v $(pwd)/sdk:/sdk thyrlian/android-sdk bash -c 'cp -a $ANDROID_HOME/. /sdk'
Throws below error
docker: invalid reference format.
See 'docker run --help'.
You're looking too far in the command for the error. In this case it's earlier. In this command:
docker run -it — rm -v $(pwd)/sdk:/sdk thyrlian/android-sdk bash -c 'cp -a $ANDROID_HOME/. /sdk'
The invalid image name is the long dash: —
. The rm
needs two normal dashes (since it's not a single character style arg like the -i
and -t
). Those are dashes that you'd type with the keyboard, and some editor that you've likely copy and pasted from converted that. The correct command is:
docker run -it --rm -v "$(pwd)/sdk:/sdk" thyrlian/android-sdk bash -c 'cp -a $ANDROID_HOME/. /sdk'
Note, you should always quote the path since it can contain a space that would also break the parsing of the args.
The issue happens when the docker image name given in the command is invalid. Please try this command
docker run -it — rm -v "$(pwd)/sdk:/sdk thyrlian/android-sdk" bash -c 'cp -a $ANDROID_HOME/. /sdk'
What's the exact command you need to run in the interactive terminal?
In your case,
"- rm" is incorrect, there should no space between - and rm, so it should be -rm
Secondly, it should be --rm and re try.
docker run -it --rm -v $(pwd)/sdk:/sdk thyrlian/android-sdk bash -c 'cp -a $ANDROID_HOME/. /sdk'