Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adb now available in Alpine Linux (edge/testing) #9

Open
qmfrederik opened this issue Nov 6, 2017 · 5 comments
Open

adb now available in Alpine Linux (edge/testing) #9

qmfrederik opened this issue Nov 6, 2017 · 5 comments

Comments

@qmfrederik
Copy link

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.

@sorccu
Copy link
Owner

sorccu commented Nov 6, 2017

That's interesting but I personally have a need for some of the other platform tools as well, though it might be fair to split those into a separate container, then.

Some other concerns:

  • I'm not entirely convinced that the alpine package won't become out of date, since they've essentially replaced the whole Android.mk system with a custom Makefile. This reminds me of the ubuntu package that was, and perhaps still is, literally years behind the official version.
  • When an adb client connects to a server, it runs a version check first. Should the version not match, the client will kill the server and attempt to start a new one. While it's certainly possible to have that version mismatch with the current image as well, I'm worried that it may become even more of an issue with the custom version - especially if any build-script breaking changes are introduced (see previous point). Unfortunately, people tend to use their host adb to connect to the adb server in the container instead of using the container adb for everything, so mismatching versions are a very real issue.

I'm willing to consider this if more people want it, but I think the space savings would be fairly minimal. I do agree that the current glibc hack is quite ugly, though.

@sorccu
Copy link
Owner

sorccu commented Nov 14, 2017

This would actually have the benefit of supporting ARM as well.

@qmfrederik
Copy link
Author

It's true that the version which ships in Alpine is slightly outdated. I guess they take PRs to their aport repository but I'm not fluent with their package management system. Alternatively, I don't know how difficult it is to build stand-alone adb from the Android repository inside an Alpine container using multi-stage builds and publish that.

This whole issue is intended mainly as a FYI - I'm exploring the area and wanted to share some of the stuff I found, as they may be of interest to you.

@sorccu
Copy link
Owner

sorccu commented Nov 14, 2017

Unfortunately it seems that the version on Alpine is already quite old. I'm not sure if I'd want to use that.

@JeffLIrion
Copy link

JeffLIrion commented Jan 14, 2019

@qmfrederik, I'm trying to make a Hass.io addon (read: basically a Docker container) that will run the ADB server, but I'm a Docker rookie and I'm having some trouble. The base image is supposed to be Alpine Linux 3.6. If you're able to offer any help, I would really appreciate it!

Here was my initial attempt. I'm pretty sure I tried the snippet from your first post (although I didn't commit and push it), but it didn't work.

https://github.com/JeffLIrion/hassio-adb-server-addon/blob/ebf4a01f12f151d16abdb56c89e6d116db8f7f99/adb_server/Dockerfile

ARG BUILD_FROM
FROM $BUILD_FROM

ENV LANG C.UTF-8

# Install requirements for add-on
RUN apk add --no-cache adb jq

# Copy data for add-on
COPY run.sh /
RUN chmod a+x /run.sh

CMD [ "/run.sh" ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants