Skip to content

Commit

Permalink
Test building a custom devcontainer.
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-matera committed Nov 26, 2023
1 parent bfd19f0 commit a7c957d
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 1 deletion.
44 changes: 44 additions & 0 deletions .github/workflows/build-devbox.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: build-devbox

on:
push:
tags:
- "devcontainer-*"
workflow_dispatch: {}

env:
REGISTRY: ghcr.io
IMAGE_NAME: "${{ github.repository }}-devcontainer"

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Extract version and branch metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=sha
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.devcontainer
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
16 changes: 16 additions & 0 deletions Dockerfile.devcontainer
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM docker.io/eprosima/vulcanexus:humble-desktop

# Setup packages needed for `make devbox-install`
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install git ansible python3-pip vim sudo

# Install the latest devbox playbook from git
COPY . /seahawk
RUN make -C /seahawk devbox-install

# For vulcanexus container... make a user.
RUN useradd -Um -d /home/student -s /usr/bin/bash --uid 1000 -G adm,sudo student \
&& echo 'student ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/student_nopasswd \
&& echo '. /opt/vulcanexus/humble/setup.bash' >> /home/student/.bashrc

USER student
7 changes: 6 additions & 1 deletion setup/roles/ros/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,19 @@
## Perform the instructions here:
# https://docs.ros.org/en/humble/Installation/Alternatives/Ubuntu-Development-Setup.html

- name: Update all packages to their latest version
ansible.builtin.apt:
name: "*"
state: latest
update_cache: yes

- name: Install helper packages
become: true
ansible.builtin.apt:
name:
- software-properties-common
- curl
state: latest
cache_valid_time: 86400 # consider cache up-to-date if its < 1 day old

- name: Check for ROS2 repos in apt sources
command: /bin/bash -c "grep -q packages.ros.org /etc/apt/sources.list /etc/apt/sources.list.d/*"
Expand Down

0 comments on commit a7c957d

Please sign in to comment.