在docker容器内创建android模拟器时出现'sh:1:file:not found' [英] 'sh: 1: file: not found' when creating a android emulator inside a docker container

查看:253
本文介绍了在docker容器内创建android模拟器时出现'sh:1:file:not found'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在docker容器中创建一个android仿真器,但是遇到了一些问题.

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

SDK更新和AVD创建成功,并且我尝试创建模拟器,出现以下错误:

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

注意:运行最新的docker版本并使用java:8-jdk映像.

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

我的dockerfile可以在这里找到=>/a>

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

-有人告诉我为API22安装x86英特尔ABI/ARM,但我无法找到软件包名称,因此可以通过命令行安装.

-- 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.

推荐答案

我遇到了同样的问题,我通过apt通过安装文件comman来解决此问题.但仍然无法正常工作,找到解决方案后我将进行更新.

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 pciutils libpulse0

在将软件包添加到您的docker文件后,我找到了解决方案

I found a solution after add packages to your docker file

也将这些命令添加到docker文件中

add your docker file these commands too

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

并使用

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

大多数现在可能正在工作.

Most probably is work now.

这篇关于在docker容器内创建android模拟器时出现'sh:1:file:not found'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆