sorccu / docker-adb

Dockerfile and instructions for ADB.
Other
200 stars 74 forks source link

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

Open qmfrederik opened 6 years ago

qmfrederik commented 6 years ago

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 commented 6 years ago

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 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 commented 6 years ago

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

qmfrederik commented 6 years ago

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 commented 6 years ago

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

JeffLIrion commented 5 years ago

@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" ]