Run-docker.sh error (/bin/su ...)

#1

If I run script run-docker.sh I’ve got following error:

./run-docker.sh make BUILD_BACKEND=1 default
Starting with UID : 1000
/bin/su: option requires an argument -- 'c'
Usage: su [options] [LOGIN]

...

it looks like the script is not passing command line arguments to docker image. I have a fix but I don’t know how the contribution flow (fork github repo and ask for pull request?) so I’m providing the patch here just in case:

diff --git a/run-docker.sh b/run-docker.sh
index 28790cb..0704e66 100755
--- a/run-docker.sh
+++ b/run-docker.sh
@@ -1,3 +1,3 @@
#!/usr/bin/env sh

-docker run -it --rm -v $(pwd):/home/dronecode/DronecodeSDK -e LOCAL_USER_ID=`id -u` dronecode/dronecode-sdk-ubuntu-18.04
+docker run -it --rm -v $(pwd):/home/dronecode/DronecodeSDK -e LOCAL_USER_ID=`id -u` dronecode/dronecode-sdk-ubuntu-18.04 "$@"

And once the patch is applied, there’s another issue I guess I’ll address in a separate post since itś related to the docker image itself

./run-docker.sh make BUILD_BACKEND=1 default Starting with UID : 1000 make: *** No targets specified and no makefile found. Stop.

#2

Oh thank you!

I’ve started a PR with your suggestions:

If you want to get GitHub contributions, here is a guide :smiley:
https://akrabat.com/the-beginners-guide-to-contributing-to-a-github-project/

#3

Oh, I see, the problem is user vs dronecode.

#4

Ok, I’ve added a commit for the wrong user:

#5

Ok, you’re really fast… :slight_smile:
Glad you also spotted the wrong user.
Thank you for the 2 commits.

There’s one more subtle detail that I think will involve updating the docker image in docker hub.
It looks like the folder /home/user already exists in the image “dronecode/dronecode-sdk-ubuntu-18.04” but the script docker/entrypoint.sh is asking for the home folder to be created when adding user “user” so this warning appears:
useradd: warning: the home directory already exists. Not copying any file from skel directory into it.

#6

You’re right. I’m gonna try to use -M instead of -m user.