Skip to content

Commit 393d7e2

Browse files
committed
Build Docker image
1 parent 68065ad commit 393d7e2

File tree

3 files changed

+87
-0
lines changed

3 files changed

+87
-0
lines changed

.github/workflows/publish-image.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
# GitHub recommends pinning actions to a commit SHA.
7+
# To get a newer version, you will need to update the SHA.
8+
# You can also reference a tag or branch, but the action may change without warning.
9+
10+
name: Create and publish a Docker image
11+
12+
on:
13+
push:
14+
branches: ['master']
15+
16+
env:
17+
REGISTRY: ghcr.io
18+
IMAGE_NAME: ${{ github.repository }}
19+
20+
jobs:
21+
build-and-push-image:
22+
runs-on: ubuntu-latest
23+
permissions:
24+
contents: read
25+
packages: write
26+
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v3
30+
31+
- name: Log in to the Container registry
32+
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
33+
with:
34+
registry: ${{ env.REGISTRY }}
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Extract metadata (tags, labels) for Docker
39+
id: meta
40+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
41+
with:
42+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
43+
44+
- name: Build and push Docker image
45+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
46+
with:
47+
context: .
48+
push: true
49+
tags: ${{ steps.meta.outputs.tags }}
50+
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FROM osrf/ros:noetic-desktop-full
2+
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
5+
RUN apt-get update \
6+
&& apt-get install -y git \
7+
&& rm -rf /var/lib/apt/lists/*
8+
9+
# apt packages
10+
11+
RUN apt-get update \
12+
&& apt-get install -y libsuitesparse-dev \
13+
&& rm -rf /var/lib/apt/lists/*
14+
15+
# Code repository
16+
17+
RUN mkdir -p /catkin_ws/src/
18+
19+
RUN git clone --recurse-submodules \
20+
https://github.com/RobotResearchRepos/KumarRobotics_msckf_vio \
21+
/catkin_ws/src/msckf_vio
22+
23+
RUN . /opt/ros/$ROS_DISTRO/setup.sh \
24+
&& apt-get update \
25+
&& rosdep install -r -y \
26+
--from-paths /catkin_ws/src \
27+
--ignore-src \
28+
&& rm -rf /var/lib/apt/lists/*
29+
30+
RUN . /opt/ros/$ROS_DISTRO/setup.sh \
31+
&& cd /catkin_ws \
32+
&& catkin_make
33+
34+

build.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
docker build -t robotresearchrepos/kumarrobotics_msckf_vio:latest .

0 commit comments

Comments
 (0)