Leonardo Galani Leonardo Galani - 1 year ago 321
Android Question

'sh: 1: file: not found' when creating a android emulator inside a docker container

I'm trying to create a android emulator inside a docker container but got some problems.

The SDK updates and AVD creation were successful and i try to create the emulator, the following error appears:

./emulator -avd test-22 -no-skin -no-audio -no-window

sh: 1: file: not found
sh: 1: file: not found

WARNING: Cannot decide host bitness because $SHELL is not properly defined; 32 bits assumed.

ERROR: 32-bit Linux Android emulator binaries are DEPRECATED, to use them

Notes: Running last docker version and using java:8-jdk image.

My dockerfile can be found here => https://gist.github.com/leoGalani/1f74621b8e82bd5bc8db586d1f34b8a2

-- Some people told me to install a x86 intel ABI/ARM for the API22 but i cant manage to find the package name so i can install it by command line.

Answer Source

I have same issue and i fix this with install file comman via apt. But still not working yet, i will update when i found a solution.

apt-get install  -y --no-install-recommends file libmagic1 libglu1-mesa mesa-utils libpci3 pciutil libpulse0

Edit: I found a solution after add packages to your docker file

add your docker file these commands too

mv /bin/sh /bin/sh.backup 
cp /bin/bash /bin/sh

And create new container with

--device /dev/dri --device /dev/video0 --device /dev/snd --device /dev/kvm 

Most probably is work now.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download