forked from dirtyjtag/DirtyJTAG
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Docker build support (dirtyjtag#97)
* Dockerfile: use Alpine Linux, export artifacts The Dockerfile has been heavily modified to make full use of docker build. The operating system has been changed to Alpine Linux, and most of the old hacks we needed for exporting binaries were removed. * Update build instructions for docker build Co-authored-by: Jean THOMAS <virgule@jeanthomas.me>
- Loading branch information
Showing
2 changed files
with
17 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,20 @@ | ||
FROM debian:jessie-slim | ||
FROM alpine:3.14 as build-stage | ||
MAINTAINER Benjamin Henrion <zoobab@gmail.com> | ||
LABEL Description="DirtyJTAG firmware for STM32 Bluepill board" | ||
|
||
RUN DEBIAN_FRONTEND=noninteractive apt-get update -y -q && apt-get install -y -q sudo make python gcc-arm-none-eabi git-core libnewlib-arm-none-eabi | ||
RUN apk add --no-cache make python3 gcc-arm-none-eabi newlib-arm-none-eabi | ||
RUN ln -sf python3 /usr/bin/python | ||
|
||
ENV user dirtyjtag | ||
RUN useradd -d /home/$user -m -s /bin/bash $user | ||
RUN echo "$user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/$user | ||
RUN chmod 0440 /etc/sudoers.d/$user | ||
ADD . /dirtyjtag | ||
WORKDIR /dirtyjtag | ||
|
||
USER $user | ||
WORKDIR /home/$user | ||
RUN mkdir -pv code | ||
COPY . ./code/ | ||
RUN sudo chown $user.$user -R /home/$user/code | ||
WORKDIR /home/$user/code/ | ||
RUN git submodule init | ||
RUN git submodule sync | ||
RUN git submodule update | ||
RUN make PLATFORM=bluepill | ||
RUN make PLATFORM=stlinkv2 | ||
RUN make PLATFORM=stlinkv2dfu | ||
RUN make PLATFORM=baite | ||
RUN make PLATFORM=olimexstm32h103 | ||
RUN make PLATFORM=stlinkv2white | ||
RUN make PLATFORM=stlinkv2white | ||
|
||
FROM scratch AS export-stage | ||
COPY --from=build-stage /dirtyjtag/src/dirtyjtag.*.bin / | ||
COPY --from=build-stage /dirtyjtag/src/dirtyjtag.*.elf / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters