Skip to content

Commit

Permalink
switching to direct docker build.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcus10110 committed Jul 11, 2023
1 parent 5af8b21 commit 42896ef
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 4 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/build.yml
Expand Up @@ -44,14 +44,13 @@ jobs:
path: ${{github.workspace}}/build/arm64/Analyzers/*.so
linux:
runs-on: ubuntu-latest
container:
image: quay.io/pypa/manylinux2014_x86_64
steps:
- uses: actions/checkout@v2
- name: Build
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
./ci/linux/docker-build.sh
./ci/linux/docker-run.sh
find .
- name: Upload Linux build
uses: actions/upload-artifact@v2
with:
Expand Down
47 changes: 47 additions & 0 deletions ci/linux/Dockerfile
@@ -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
7 changes: 7 additions & 0 deletions ci/linux/build.sh
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

mkdir build
pushd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
popd
7 changes: 7 additions & 0 deletions ci/linux/docker-build.sh
@@ -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
8 changes: 8 additions & 0 deletions ci/linux/docker-run.sh
@@ -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

0 comments on commit 42896ef

Please sign in to comment.