Skip to content

Commit

Permalink
Merge pull request #65 from twiest/convert-ubuntu-package
Browse files Browse the repository at this point in the history
Add convert-ubuntu-package example
  • Loading branch information
jmarrero committed Sep 5, 2023
2 parents 7442c84 + f37cb01 commit d6606e8
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/convert-ubuntu-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Build image: convert-ubuntu-package"

env:
IMAGE_NAME: "convert-ubuntu-package"

on:
pull_request:
branches:
- main
paths:
- convert-ubuntu-package/*
- .github/workflows/convert-ubuntu-package.yml
push:
branches:
- main
paths:
- convert-ubuntu-package/*
- .github/workflows/convert-ubuntu-package.yml

jobs:
build-image:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Build container image
uses: redhat-actions/buildah-build@v2
with:
context: ${{ env.IMAGE_NAME }}
containerfiles: ${{ env.IMAGE_NAME }}/Containerfile
image: ${{ env.IMAGE_NAME }}
layers: false
oci: true
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ functionality.
- [ansible-firewalld](ansible-firewalld/): Demos using [Ansible](https://github.com/ansible/ansible) to configure [firewalld](https://github.com/firewalld/firewalld)
- [build-zfs-module](build-zfs-module/): Build the ZFS third party module as rpm and install it
- [butane](butane/): Demos using https://github.com/coreos/butane
- [convert-ubuntu-package](convert-ubuntu-package/): Convert an Ubuntu package to rpm using [alien](https://wiki.debian.org/Alien) and install it.
- [initramfs-module](initramfs-module/): Demos generating a initramfs with specific modules added and omitted.
- [inject-go-binary](inject-go-binary/): Demos adding building and injecting a Go binary + systemd unit
- [podman-next](podman-next): Use COPR to install the podman-next package
Expand Down
13 changes: 13 additions & 0 deletions convert-ubuntu-package/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Convert an Ubuntu package to rpm using alien and install it
FROM ubuntu:latest as converter
RUN apt update && \
apt install -y alien && \
cd /tmp && \
apt download gocryptfs && \
alien --to-rpm --scripts --fixperms gocryptfs*.deb

FROM quay.io/fedora/fedora-coreos:stable
COPY --from=converter /tmp/gocryptfs*.rpm /tmp
RUN rpm-ostree install /tmp/gocryptfs*.rpm && \
rm /tmp/gocryptfs*.rpm && \
ostree container commit
5 changes: 5 additions & 0 deletions convert-ubuntu-package/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Convert an Ubuntu Package and Install It

This example converts an Ubuntu package into an rpm using [alien](https://wiki.debian.org/Alien) an then installs it using `rpm-ostree`.

This is useful for packages that are present in Ubuntu, but not in Fedora. This example installs Ubuntu's latest packaged version of gocryptfs, which is [no longer maintained in Fedora](https://discussion.fedoraproject.org/t/gocryptfs-not-available-on-fedora-36).

0 comments on commit d6606e8

Please sign in to comment.