Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
Add experimental host-runner shims for well known-binaries
Browse files Browse the repository at this point in the history
Loosely based off containers/toolbox#145

Doesn't work with sudo and hard coded shims in the docker container.
Pending better UIX with containers/toolbox#553

Signed-off-by: anthr76 <hello@anthonyrabbito.com>
  • Loading branch information
anthr76 committed Mar 17, 2021
1 parent 189ec63 commit 3fac8b0
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
2 changes: 2 additions & 0 deletions images/shim/00-shim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ echo ""
echo "Starting ansible-pull provision..."
echo "manually run with provision"

export PATH="/usr/libexec/toolbox:$PATH"

sleep 1

nohup ansible-pull -U https://github.com/anthr76/tooling.git -i "$(uname -n)," --diff -e playbook_dir shim/local.yml &>/tmp/last-ansible-pull &
Expand Down
15 changes: 15 additions & 0 deletions images/shim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,19 @@ RUN dnf clean all

COPY 00-shim.sh /etc/profile.d/00-shim.sh

RUN mkdir /usr/libexec/toolbox
COPY host-runner /usr/libexec/toolbox/host-runner

RUN ls /usr/libexec/toolbox \
&& \
chmod +x /usr/libexec/toolbox/host-runner \
&& \
ln -s /usr/libexec/toolbox/host-runner /usr/libexec/flatpak \
&& \
ln -s /usr/libexec/toolbox/host-runner /usr/libexec/virsh \
&& \
ln -s /usr/libexec/toolbox/host-runner /usr/libexec/podman \
&& \
ln -s /usr/libexec/toolbox/host-runner /usr/libexec/virt-install

CMD /bin/sh
5 changes: 5 additions & 0 deletions images/shim/host-runner
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
# https://github.com/containers/toolbox/issues/145
executable=$(basename $0)
set -x
exec flatpak-spawn --host --watch-bus --forward-fd=1 --forward-fd=2 --directory=$(pwd) --env=TERM=xterm-256color $executable "$@"
11 changes: 10 additions & 1 deletion shim/tasks/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@
name: "*"
state: latest

- name: 'install OBS repo'
- name: 'install OBS k8s repo'
command:
cmd: dnf config-manager --add-repo https://download.opensuse.org/repositories/home:anthr76:kubernetes/openSUSE_Tumbleweed/home:anthr76:kubernetes.repo
warn: false
args:
creates: /etc/dnf/repos.d/home:anthr76:kubernetes.repo

- name: 'install OBS repo'
command:
cmd: dnf config-manager --add-repo https://download.opensuse.org/repositories/home:anthr76/openSUSE_Tumbleweed/home:anthr76.repo
warn: false
args:
creates: /etc/dnf/repos.d/home:anthr76.repo

- name: 'install packages'
dnf:
name:
Expand All @@ -27,3 +34,5 @@
- go
- python38-pre-commit
- gh
- flatpak-xdg-utils

0 comments on commit 3fac8b0

Please sign in to comment.