Skip to content

Commit

Permalink
Add devcontainer image
Browse files Browse the repository at this point in the history
  • Loading branch information
plfiorini committed Apr 30, 2024
1 parent 718fab7 commit 72543ce
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,10 @@ jobs:
secrets:
docker_username: ${{ secrets.DOCKER_USERNAME }}
docker_password: ${{ secrets.DOCKER_PASSWORD }}
build-devcontainer:
uses: ./.github/workflows/build-image.yml
with:
name: devcontainer
secrets:
docker_username: ${{ secrets.DOCKER_USERNAME }}
docker_password: ${{ secrets.DOCKER_PASSWORD }}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ Container Images for CI
* **suse-qt515:** OpenSuSE with Qt 5.15
* **suse-qt66:** OpenSuSE with Qt 6.6
* **fedora:** Fedora Rawhide
* **devcontainer:** Arch Linux based image for Visual Studio Code

The following images don't have the documentation inside, meaning they are not
suitable to build Qt documentation such as Fluid API documentation:

* suse-qt515
* suse-qt66
* fedora
* devcontainer

## Build

Expand Down
53 changes: 53 additions & 0 deletions devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
FROM archlinux:latest as base

# Install packages
FROM base AS install
RUN echo -en "[kde-unstable]\nInclude = /etc/pacman.d/mirrorlist\n$(cat /etc/pacman.conf)\n" > /etc/pacman.conf && \
sed -i '/\[testing\]/a [extra-testing]\nInclude = /etc/pacman.d/mirrorlist' /etc/pacman.conf
RUN pacman -Syu --noconfirm && \
pacman -S --noconfirm \
base-devel \
git \
clang \
qt6-base \
qt6-5compat \
qt6-connectivity \
qt6-declarative \
qt6-doc \
qt6-examples \
qt6-imageformats \
qt6-multimedia \
qt6-quickeffectmaker \
qt6-quicktimeline \
qt6-svg \
qt6-tools \
qt6-wayland \
polkit-qt6 \
pkg-config \
cmake \
ninja \
extra-cmake-modules \
solid \
networkmanager-qt \
modemmanager-qt \
libdrm \
libinput \
libxcvt \
libdisplay-info \
wayland-protocols

# User variables
ARG USERNAME=liriuser
ARG USER_UID=1000
ARG USER_GID=$USER_UID

# Create the user
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& pacman -Sy --noconfirm \
&& pacman -S --noconfirm sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME

# Set the default user
USER $USERNAME
22 changes: 22 additions & 0 deletions devcontainer/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ORG=liridev
NAME=devcontainer
VERSION=latest

DOCKER ?= docker

build:
$(DOCKER) buildx build --no-cache-filter install -t $(ORG)/$(NAME):$(VERSION) .

push:
ifeq ($(DOCKER),docker)
$(DOCKER) push $(ORG)/$(NAME):$(VERSION)
else
$(DOCKER) push $(ORG)/$(NAME):$(VERSION) docker://docker.io/$(ORG)/$(NAME):$(VERSION)
endif

all: build

clean:
$(DOCKER) rmi $(ORG)/$(NAME):$(VERSION)

.PHONY: build

0 comments on commit 72543ce

Please sign in to comment.