sorccu / docker-adb Goto Github PK
View Code? Open in Web Editor NEWDockerfile and instructions for ADB.
License: Other
Dockerfile and instructions for ADB.
License: Other
I love having adb in a docker image, this works great but I couldn't get fastboot to work.
This is my script (that is in my $PATH) to run fastboot
#!/bin/bash
docker run --name=adbd --rm -d --privileged -v /dev/bus/usb:/dev/bus/usb sorccu/adb &&
docker run --rm -ti --net container:adbd -v $HOME:/home/$USER/ sorccu/adb fastboot $@
I don't see devices but when I use the system installed version I do. Any ideas?
Hey, @sorccu
I am trying to get stf running as a device provider on an Odroid XU4 running Arch Linux for a day now and couldn't get this working...
You said, that your XU4 is running smoothely here, so I assume you got your ADB container working on your XU4, but how did you handle this?
When I start your container, I get the error standard_init_linux.go:195: exec user process caused "exec format error"
.
Did you stumble upon this error before?
Research on the net shows, that it's either a architecture error or encoding... But I couldn't figure out what the actual problem is here...
I also tried building the container on the machine, but this didn't work either. When I start this, the 'adb' command throws the error from above...
Do you have any hints on that?
Hello,
Thank you for this repo, it is greatly helping me.
Here is the thing I would like to talk with you:
1- Ones I start docker with pattern -1 or -2, docker adb also appear in host machine processes. ps -ef | grep adb
. Also when I run adb devices
it normally run just as adb running on host. Is not this abnormal since adb process is actually running inside docker image.
2- Normally docker run
is to start a container. It seems you are doing multiple docker run
in one of the patters you explain. do you think these actually should be docker exec
.
ex. pattern 2
docker run -d --privileged --net host -v /dev/bus/usb:/dev/bus/usb --name adbd sorccu/adb
docker exec adbd adb devices
Thank you
Anyone else with the same problem?
Without the device's virtual representation, how can I forward it to docker??
Thanks!
I cannot mount /dev on Mac.
Have you tried using this image on Mac?
When running this container and using the CLI to pull a file from an android device, where does the file GO?
docker run --rm -ti --net host sorccu/adb adb pull remotefilename
It says it successfully grabs it. But I can't find it locally or in the container's filesystem. /shrug
Hello!
I've faced with some problem, I moved inside container adb version 1.0.31 and after reboot device via adb reboot
device isn't in the device list. But with your last container version (adb version 1.0.39) everything is okay.
Maybe error with container rebuilding? I made it a little bit dirty. But also how can I change adb version of the container easily?
I saw that the changes you made 18 days ago dont seem to be on the hub.docker.com.
The build have failed.
Hi,
Love the docker image, works great for openstf farm, but we ran into an issue setting it up on RaspberryPi nodes running stf-provider.
Solution was to recompile it on the pi with armv7 support.
@sorccu What are your thoughts on setting up automated builds for armv7 along side the current ones? Happy to help where possible.
There's a mistake in both the Dockerfile and the documentation: The path of the adbkeys is /root/.android/
not /.android/
Do you want a PR?
Here is a proper approach: https://stackoverflow.com/a/66427245/758986. You might want to add the info in README.
Hello,
i'm trying to use a adb container to connect to my genymotion emulator.
Have you tried to do something like this?
Julien
I set this up on my unraid machine. All my containers shutdown for backups over night so I need a way to have it auto connect again to my devices. Possible?
Im trying to run test against real device, appium is running inside container
the device is connected to the device farm, which mean device is connected to the adb sever on the host machine, so to make it visible for adb inside the container i have kill-server from adb in the host machine.
So i was wondering if there way to connect adb in container to adb server in host, so i dont have to manually intervene and kill-server then again allow access for adb in container
hello, guys,
just something to add to fulfil the Pattern 2 - Host network (easy but feels wrong)
same way to start the server by binding the ADB server directly to the host, and know the host ip to lanuch the adb client in the same machine:
docker run -e "ADB_SERVER_SOCKET=tcp:xxxxx:5037" xxx:xx adb devices
need pass the host ip to container by environment variable.
each container in the same machine still have own ip.
It would reduce the dependencies a lot, and perhaps we could then build an extremely small image on top of Alpine.
FYI, there's now a android-tools package in Alpine edge which contains adb
and fastboot
only. It has been compiled natively for Alpine Linux so you don't need to rely on the glibc package anymore.
Here's the command I used to install it on an Alpine container:
RUN apk --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ add android-tools
This, and upgrading to Alpine 3.6, should help you reduce the container size even further.
When I run docker build -t docker-adb .
I get the following error:
/root/update-platform-tools.sh
No such file or directory
The command '/bin/sh -c set -xeo pipefail && apk update && apk add wget ca-certificates tini && wget -O "/etc/apk/keys/sgerrand.rsa.pub" "https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub" && wget -O "/tmp/glibc.apk" "https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-2.28-r0.apk" && wget -O "/tmp/glibc-bin.apk" "https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-bin-2.28-r0.apk" && apk add "/tmp/glibc.apk" "/tmp/glibc-bin.apk" && rm "/etc/apk/keys/sgerrand.rsa.pub" && rm "/root/.wget-hsts" && rm "/tmp/glibc.apk" "/tmp/glibc-bin.apk" && rm -r /var/cache/apk/APKINDEX.* && /root/update-platform-tools.sh' returned a non-zero code: 127
Can anyone help?
Best regards.
When i run the command for list adb device the list is empty but running adb device
from my computer (without start container) device detected.
~/github $ docker run --rm -ti --net container:adbd sorccu/adb adb devices
List of devices attached
~/github $ adb devices
List of devices attached
ZY3226JH4J device
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.