ccarcaci / andocker

10 stars 5 forks source link

Permission problems #1

Closed jphilippou closed 4 years ago

jphilippou commented 4 years ago

I ran into permission problems within the docker container so I changed Dockerfile-expo to:

from node:latest label version=0.0.1

env PATH="/platform-tools:${PATH}"

copy ecosystem/run-expo-app.sh /app/

RUN apt-get update && \ apt-get -y install sudo

RUN adduser --disabled-password --gecos '' docker RUN adduser docker sudo RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

USER docker

run sudo npm install -g expo-cli run sudo apt-get update && \ yes | sudo apt-get install zip apt-utils && \ sudo wget -q https://dl.google.com/android/repository/platform-tools-latest-linux.zip && \ sudo unzip -q platform-tools-latest-linux.zip && \ sudo rm platform-tools-latest-linux.zip && \ sudo chmod +x app/run-expo-app.sh

env DOCKERIZE_VERSION v0.6.1 run sudo wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ && sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ && sudo rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz

workdir /app cmd ./run-expo-app.sh

AND run-expo-app.sh to:

cd ../code sudo npm i dockerize -wait tcp://emulator:5555 adb connect emulator:5555 adb devices npm run android

and am blocked with the following:

emulator | 2019-11-24 07:40:11,824 INFO exited: auto-recording (exit status 0; expected) expo | npm WARN tar ENOENT: no such file or directory, open '/code/node_modules/.staging/metro-resolver-2cb38ae2/package.json' expo | npm WARN tar ENOENT: no such file or directory, open '/code/node_modules/.staging/metro-resolver-2cb38ae2/README.md' expo | npm WARN tar ENOENT: no such file or directory, open '/code/node_modules/.staging/metro-resolver-2cb38ae2/rn-babelrc.json' expo | npm WARN tar ENOENT: no such file or directory, open '/code/node_modules/.staging/mime-db-2cf030f4/HISTORY.md' . . . expo | npm WARN tar ENOENT: no such file or directory, open '/code/node_modules/.staging/rxjs-1b825c37/src/LICENSE.txt' expo | npm ERR! code 128 expo | npm ERR! Command failed: git clone --depth=1 -q -b v0.22.1-exp.0 git://github.com/expo/react-native-maps.git /root/.npm/_cacache/tmp/git-clone-99b43 expo | npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-99b43052': Permission denied expo | npm ERR! expo | expo | npm ERR! A complete log of this run can be found in: expo | npm ERR! /root/.npm/_logs/2019-11-24T15_40_18_425Z-debug.log expo | 2019/11/24 15:40:18 Waiting for: tcp://emulator:5555 expo | 2019/11/24 15:40:18 Connected to tcp://emulator:5555 expo | daemon not running; starting now at tcp:5037 expo | daemon started successfully expo | connected to emulator:5555 expo | List of devices attached expo | emulator:5555 device expo | expo | expo | > @ android /code expo | > expo start --android expo | expo | [15:40:23] EACCES: permission denied, open '/code/.expo/settings.json.4268604732' expo | [15:40:23] Set EXPO_DEBUG=true in your env to view the stack trace. expo | npm ERR! code ELIFECYCLE expo | npm ERR! errno 1 expo | npm ERR! @ android: expo start --android expo | npm ERR! Exit status 1 expo | npm ERR! expo | npm ERR! Failed at the @ android script. expo | npm ERR! This is probably not a problem with npm. There is likely additional logging output above. expo | expo | npm ERR! A complete log of this run can be found in: expo | npm ERR! /home/docker/.npm/_logs/2019-11-24T15_40_23_072Z-debug.log expo exited with code 1

ccarcaci commented 4 years ago

I'll watch into it soon.

ccarcaci commented 4 years ago

Hi @jphilippou, what were the permission problems you encountered?

Don't mind I got the problem, Docker runs as daemon and use root user. I'll fix it.

ccarcaci commented 4 years ago

Hi @jphilippou In this branch you'll find a working version without permission problems: https://github.com/ccarcaci/andocker/tree/issue/1/permission-problems

The react-native app within code folder is not working because of the new dependencies version. I'm fixing it but you could start working using this branch ;)

jphilippou commented 4 years ago

Thanks so much for fixing this!

Jim

On Dec 2, 2019, at 4:48 PM, Claudio Carcaci notifications@github.com wrote:

 Hi @jphilippou In this branch you'll find a working version without permission problems: https://github.com/ccarcaci/andocker/tree/issue/1/permission-problems

The react-native app within code folder is not working because of the new dependencies version. I'm fixing it but you could start working using this branch ;)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

ccarcaci commented 4 years ago

@jphilippou everything fixed now ;) Try it and let me know if it is working (open a new issue in case something is wrong)