Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,12 @@
#

FROM debian:stretch
ENV DEBIAN_FRONTEND noninteractive
WORKDIR /app
COPY . /app

RUN apt update && apt-get install -y cmake git gcc-arm-none-eabi locales python python-pip
RUN apt install -y libbz2-1.0 libncurses5 libz1 valgrind astyle clang libudev-dev python-urllib3 libssl1.0-dev
RUN apt install -y libbz2-dev libbz2-dev libbz2-1.0 libncurses5 libz1 valgrind astyle clang libudev-dev python-urllib3
RUN pip install --prefix /usr/local cpp-coveralls
RUN locale-gen UTF-8
ENV CC gcc
RUN cd /app/ && mkdir docker-build && cd docker-build && cmake .. -DBUILD_TYPE=firmware -DUSE_SECP256K1_LIB=ON && make TEST=yes
RUN sha256sum docker-build/bin/*

CMD ["bash"]
1 change: 0 additions & 1 deletion Dockerfile.tests
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ ENV DEBIAN_FRONTEND noninteractive
WORKDIR /app
COPY . /app


RUN gcc -v
RUN clang -v
ENV CC gcc
Expand Down
50 changes: 50 additions & 0 deletions dockerdev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash -e
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wong license

# Copyright 2018 Shift Devices AG
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"

dockerdev () {
local container_image=shift/mcu-base
local container_name=mcu-dev

if ! docker images | grep -q $container_image; then
echo "No $container_image docker image found! Maybe you need to run 'docker build --tag $container_image -f Dockerfile.dev .'?" >&2
exit 1
fi

# If already running, enter the container.
if docker ps | grep -q $container_name; then
docker exec -it $container_name bash
return
fi

if docker ps -a | grep -q $container_name; then
docker rm $container_name
fi

local repo_path="$DIR"
docker run \
--detach \
--privileged -v /dev/bus/usb:/dev/bus/usb \
--interactive --tty \
--name=$container_name \
-v $repo_path:/app \
$container_image bash

# Call a second time to enter the container.
dockerdev
}

dockerdev