Skip to content

Instantly share code, notes, and snippets.

@scintill
Created August 30, 2017 08:58
Show Gist options
  • Save scintill/cf94dbea0ab7224e0e411e4bca8fc03b to your computer and use it in GitHub Desktop.
Save scintill/cf94dbea0ab7224e0e411e4bca8fc03b to your computer and use it in GitHub Desktop.
docker-uqmi
FROM trinitronx/build-tools:alpine-3.6
RUN apk add --no-cache cmake
RUN git clone https://git.openwrt.org/project/uqmi.git
RUN git clone https://git.openwrt.org/project/libubox.git
RUN git clone https://github.com/json-c/json-c.git
WORKDIR /json-c
RUN ./autogen.sh && ./configure && make install
WORKDIR /libubox
RUN cmake . -DBUILD_LUA=OFF -DBUILD_EXAMPLES=OFF && make install
WORKDIR /uqmi
RUN cmake . && make install
# second stage (new-ish Docker feature) for smaller image
FROM gliderlabs/alpine:3.6
COPY --from=0 /usr/local/sbin/uqmi /usr/bin/uqmi
COPY --from=0 /usr/local/lib/libblobmsg_json.so /usr/lib
COPY --from=0 /usr/local/lib/libubox.so /usr/lib
COPY --from=0 /usr/local/lib/libjson-c.so.3 /usr/lib
ENTRYPOINT ["/usr/bin/uqmi"]
# remnants of other envs I experimented with
#FROM trinitronx/build-tools:ubuntu-1604
#FROM ubuntu:16.04
#RUN apt-get install git build-essential pkg-config automake libtool
#RUN apt-get -y install cmake
#ARG DEBIAN_FRONTEND=noninteractive
#FROM bitnami/minideb:jessie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment