Skip to content

Commit

Permalink
Github action for Docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
fcladera committed Jan 25, 2024
1 parent 931a6f0 commit 16a6ff2
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: docker-build-base

# Only build base when any of the files in the base directory are modified
on:
push:
branches: [master, ci]
tags:
- '*'
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'

jobs:
main:
runs-on: ubuntu-20.04

steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}"
push: false
platforms: linux/amd64
build-args: git_hash=${{ github.sha }}
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Note: this Dockerfile is only used for the CI. Please refer to the
# instructions in README.md to use this repo

FROM kumarrobotics/jackal-master:latest

# Requires a docker build argument `user_id`
ARG user_id=1000
env USER dcist
ARG git_hash

# Create a base docker environment
RUN . ~/jackal_ws/devel/setup.sh \
&& mkdir -p ~/user_ws/src && cd ~/user_ws \
&& catkin config --extend ~/jackal_ws/devel \
&& catkin build --no-status -DCMAKE_BUILD_TYPE=Release

# Clone the git directory
RUN cd ~/user_ws/src \
&& git clone --recursive -j4 https://github.com/KumarRobotics/spomp-system.git \
&& cd spomp-system \
&& git checkout ${git_hash}

# Build the workspace
RUN cd ~/user_ws \
&& catkin build --no-status -DCMAKE_BUILD_TYPE=Release \
&& catkin build

0 comments on commit 16a6ff2

Please sign in to comment.