Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5af8b21
commit 42896ef
Showing
5 changed files
with
72 additions
and
4 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
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Dockerfile for building Saleae analyzers on linux | ||
# This allows us to maintain support for older distros while building on recent distros. | ||
|
||
# Use Ubuntu 18.04 as the base image | ||
FROM ubuntu:18.04 | ||
|
||
# Set environment variables to avoid any interactive prompts during package installation | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# UID and GID are generally used to create a user with the same user and group ids as the user building this Docker image | ||
ARG UID | ||
ARG GID | ||
|
||
# Ensure args are set | ||
RUN test -n "$UID" | ||
RUN test -n "$GID" | ||
|
||
# Create user | ||
RUN groupadd -g ${GID} docker | ||
RUN useradd -m -u ${UID} -g docker docker | ||
|
||
# Update cmake | ||
RUN apt-get update | ||
|
||
# Add repository for latest cmake | ||
RUN apt-get -y install ca-certificates gpg wget software-properties-common | ||
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null | ||
RUN echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ bionic main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null | ||
|
||
RUN apt-get -y install software-properties-common | ||
|
||
# Add repository for GCC 10 | ||
RUN add-apt-repository ppa:ubuntu-toolchain-r/test | ||
|
||
RUN apt-get update | ||
|
||
RUN apt-get -y install cmake git | ||
RUN apt-get -y install gcc-10 g++-10 | ||
|
||
ENV CXX=g++-10 | ||
ENV CC=gcc-10 | ||
|
||
RUN mkdir -p /workspace/analyzer | ||
RUN chown docker:docker /workspace | ||
|
||
# Set working directory | ||
WORKDIR /workspace/analyzer |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
mkdir build | ||
pushd build | ||
cmake -DCMAKE_BUILD_TYPE=Release .. | ||
cmake --build . | ||
popd |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Path to THIS script | ||
SCRIPT_PATH=`dirname $0` | ||
SCRIPT_PATH=`readlink -e $SCRIPT_PATH` | ||
|
||
docker build --build-arg UID=`id -u` --build-arg GID=`id -g` -t analyzer-build $SCRIPT_PATH |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Path to THIS script | ||
SCRIPT_PATH=$(dirname $0) | ||
SCRIPT_PATH=$(readlink -e $SCRIPT_PATH) | ||
REPO_ROOT=$SCRIPT_PATH/../.. | ||
|
||
echo docker run --rm -v${REPO_ROOT}:/workspace/analyzer -u docker:docker analyzer-build ./ci/linux/build.sh |