Skip to content

Commit

Permalink
Make CONFIG as build-arg
Browse files Browse the repository at this point in the history
  • Loading branch information
Kukunin committed May 31, 2020
1 parent eb9f346 commit 088bb5e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ARG CONFIG=gcw0

FROM debian:buster AS builder

RUN apt-get update && apt-get install -y \
Expand Down Expand Up @@ -31,22 +33,23 @@ USER buildroot

COPY --chown=buildroot:buildroot . /opt/buildroot

ENV CONFIG gcw0
ARG CONFIG

RUN make od_${CONFIG}_defconfig BR2_EXTERNAL=board/opendingux
RUN make source
RUN make sdk BR2_SDK_PREFIX=${CONFIG}-toolchain
RUN tar xzvf output/images/gcw0-toolchain.tar.gz
RUN tar xzvf output/images/${CONFIG}-toolchain.tar.gz

FROM debian:buster

RUN apt-get update && apt-get install -y \
file \
&& rm -rf /var/lib/apt/lists/*

COPY --from=builder /opt/buildroot/gcw0-toolchain /opt/gcw0-toolchain
ARG CONFIG
COPY --from=builder /opt/buildroot/${CONFIG}-toolchain /opt/${CONFIG}-toolchain

WORKDIR /opt/gcw0-toolchain
ENV PATH ${PATH}:/opt/gcw0-toolchain/bin
WORKDIR /opt/${CONFIG}-toolchain
ENV PATH ${PATH}:/opt/${CONFIG}-toolchain/bin

RUN ./relocate-sdk.sh

0 comments on commit 088bb5e

Please sign in to comment.