Skip to content

Commit

Permalink
dev: reduce docker layers & combine install commands
Browse files Browse the repository at this point in the history
  • Loading branch information
cstenglein committed Nov 9, 2022
1 parent 37c6d9b commit 9ce3b08
Showing 1 changed file with 13 additions and 20 deletions.
33 changes: 13 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ RUN apt-get update && apt-get install -y \
lib32z1 \
libusb-1.0-0-dev \
libudev-dev \
libhidapi-dev

RUN apt-get update && apt-get install -y \
libhidapi-dev \
doxygen \
graphviz

Expand All @@ -75,22 +73,20 @@ RUN python3 -m pip install --upgrade pip

# Python modules
COPY py/bitbox02 /tmp/bitbox02
RUN python3 -m pip install /tmp/bitbox02
RUN rm -r /tmp/bitbox02
RUN python3 -m pip install /tmp/bitbox02 && \
rm -r /tmp/bitbox02
COPY py/requirements.txt /tmp
RUN python3 -m pip install --upgrade --requirement /tmp/requirements.txt
RUN rm /tmp/requirements.txt
RUN python3 -m pip install --upgrade --requirement /tmp/requirements.txt && \
rm /tmp/requirements.txt

# Python modules for CI
RUN python3 -m pip install --upgrade \
# Python modules for CI
pylint==2.13.9 \
pylint-protobuf==0.20.2 \
black==22.3.0 \
mypy==0.960 \
mypy-protobuf==3.2.0

# Python modules for packaging
RUN python3 -m pip install --upgrade \
mypy-protobuf==3.2.0 \
# Python modules for packaging
setuptools==41.2.0 \
wheel==0.33.6 \
twine==1.15.0
Expand All @@ -104,16 +100,13 @@ ENV PATH /opt/protoc/bin:$PATH
# Make Python3 the default
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1

# Developer tools
RUN apt-get update && apt-get install -y \
bash-completion
# Install gcovr from PIP to get a newer version than in apt repositories
RUN python3 -m pip install gcovr

# Install Go, used for the tools in tools/go and for test/gounittest
ENV GOPATH /opt/go
ENV GOROOT /opt/go_dist/go
ENV PATH $GOROOT/bin:$GOPATH/bin:$PATH
ENV GOPATH=/opt/go \
GOROOT=/opt/go_dist/go \
PATH=$GOROOT/bin:$GOPATH/bin:$PATH
RUN mkdir -p /opt/go_dist && \
curl https://dl.google.com/go/go1.19.3.linux-amd64.tar.gz | tar -xz -C /opt/go_dist

Expand All @@ -122,8 +115,8 @@ RUN cd /opt && wget https://github.com/linux-test-project/lcov/releases/download
ENV PATH /opt/lcov-1.14/bin:$PATH

# Install rust compiler
ENV PATH /opt/cargo/bin:$PATH
ENV RUSTUP_HOME=/opt/rustup
ENV PATH=/opt/cargo/bin:$PATH \
RUSTUP_HOME=/opt/rustup
COPY src/rust/rust-toolchain /tmp/rust-toolchain
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | CARGO_HOME=/opt/cargo sh -s -- --default-toolchain $(cat /tmp/rust-toolchain | tr -d '\r\n\t') -y
RUN rustup target add thumbv7em-none-eabi
Expand Down

0 comments on commit 9ce3b08

Please sign in to comment.