mirror of
https://github.com/im-tomu/fomu-toolchain.git
synced 2024-09-20 02:40:08 +00:00
52 lines
1.7 KiB
Docker
52 lines
1.7 KiB
Docker
ARG IMAGE="python:3-slim-buster"
|
|
|
|
#---
|
|
# Place anything that is common to both the build and execution environment in base
|
|
#
|
|
FROM $IMAGE AS base
|
|
|
|
RUN apt-get update -qq \
|
|
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
|
|
ca-certificates \
|
|
git \
|
|
libusb-1.0-0 \
|
|
make \
|
|
wget \
|
|
&& apt-get autoclean && apt-get clean && apt-get -y autoremove \
|
|
&& update-ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists
|
|
|
|
RUN wget https://github.com/im-tomu/fomu-toolchain/releases/download/v1.5.6/fomu-toolchain-linux_x86_64-v1.5.6.tar.gz && \
|
|
tar -xvf fomu-toolchain-linux_x86_64-v1.5.6.tar.gz && \
|
|
rm fomu-toolchain-linux_x86_64-v1.5.6.tar.gz
|
|
|
|
ENV PATH=/fomu-toolchain-linux_x86_64-v1.5.6/bin:$PATH
|
|
|
|
FROM base as release-candidate
|
|
|
|
ENV USER=fomu
|
|
RUN adduser --disabled-password ${USER}
|
|
|
|
RUN usermod -a -G plugdev ${USER}
|
|
# COPY 99-fomu.rules /etc/udev/rules.d/99-fomu.rules
|
|
USER ${USER}
|
|
WORKDIR /home/${USER}
|
|
|
|
# Commented section to show where we would run tests in an image layer identical to the release candidate
|
|
# without polluting the release candidate with test results. Uncomment the following and add tests:
|
|
# FROM release-candidate as test-release-candidate
|
|
# Ideally we would run some tests here
|
|
|
|
FROM release-candidate as fomu-toolchain
|
|
|
|
# Below are some sample commands to build and run a docker images.
|
|
#
|
|
# docker build -f Dockerfile.use-installer . -t fomu-toolchain
|
|
#
|
|
# docker run -it -v $(pwd):/home/fomu fomu-toolchain bash
|
|
#
|
|
# The --privileged param may be used to allow access to usb devices
|
|
# but it allows access to much more, and may be a security risk.
|
|
# There may be a better way to allow dfu-util to run
|
|
# docker run -it -v $(pwd):/home/fomu --privileged fomu-toolchain bash
|