Skip to content

Commit a09d6d1

Browse files
junghanspraiskup
authored andcommitted
CI: add docker build
1 parent ef179b2 commit a09d6d1

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

.github/workflows/Dockerfile

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM registry.fedoraproject.org/fedora:rawhide
2+
3+
RUN dnf -y install fedpkg tito argparse-manpage bash-completion python3-devel python3-jsonschema python3-pytest
4+
RUN useradd -m -G mock -u 1001 user
5+
WORKDIR /home/user
6+
7+
COPY mock/ /home/user/mock
8+
RUN chown -R user:user /home/user/mock
9+
USER user
10+
WORKDIR /home/user/mock/mock-core-configs
11+
RUN tito build --rpm
12+
WORKDIR /home/user/mock/mock
13+
RUN tito build --test --rpm
14+
USER root
15+
RUN dnf -y install --allow-downgrade /tmp/tito/*/mock*.rpm
16+
USER user

.github/workflows/docker-build.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: dockertest
2+
on:
3+
push:
4+
pull_request:
5+
6+
jobs:
7+
dockertest:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Set up Docker Buildx
11+
uses: docker/setup-buildx-action@v3
12+
- name: Checkout mock
13+
uses: actions/checkout@v4
14+
with:
15+
path: mock
16+
fetch-depth: 0
17+
- name: Build new image with mock in it and Load it into Docker for testing
18+
uses: docker/build-push-action@v6
19+
with:
20+
tags: mockenv:latest
21+
file: mock/.github/workflows/Dockerfile
22+
context: .
23+
pull: true
24+
push: false
25+
load: true
26+
- run: docker run --privileged --cap-add=SYS_ADMIN -t --rm mockenv:latest sh -c "mock --shell echo hello world"

0 commit comments

Comments
 (0)