[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [atomic-devel] Extending Atomic Host and 'rpm-ostree pkg-add'
- From: Jakub Filak <jfilak redhat com>
- To: Daniel J Walsh <dwalsh redhat com>, atomic-devel <atomic-devel projectatomic io>
- Subject: Re: [atomic-devel] Extending Atomic Host and 'rpm-ostree pkg-add'
- Date: Fri, 18 Nov 2016 15:26:33 +0100
The script was initially developed on Fedora Rawhide, so it works there.
I had to add a couple of hacks to be able to run it on Atomic. Mainly
because Atomic does not have rpm-build, which itself has tons of
dependencies, and I decided to run the script in a container. Soon I found
out that not only missing rpm-build is a problem but "rpm -i" does not work
on Atomic. However I overcome this problem with a wrapper for rpm [0].
The bottom line is that to make the script working on the current Atomic,
you must install rpm-build (possibly in a privileged Fedora container that
shares PID NS with the host) and issue the below command:
$ PATH="./atomic-host:$PATH" ./af install --rpm <container_name>
On Fedora you just need to run only:
$ ./af install --rpm <container_name>
Full example:
[host] $ docker pull elcolio/etcd
[host] $ docker run -d --name etcd elcolio/etcd
[host] $ docker run --privileged --pid=host -it --rm fedora sh
[cntr] $ dnf install rpm-build git
[cntr] $ cd tmp && git clone https://github.com/jfilak/af && cd af
[cntr] $ PATH="./atomic-host:$PATH" ./af install --rpm etcd
[cntr] $ exit
[host] $ rpm -qf /etc/etcd.conf
C_etcd___docker.io_elcolio_etcd-latest.0.noarch
For sake of simplicity, I assume that the /exports/hostfs/etc/etcd.conf file
exists within the container.
Jakub
PS: The script is just a proof of concept that I created over night.
0: https://github.com/jfilak/af/blob/master/atomic-host/rpm
On 11/18/2016 01:52 PM, Daniel J Walsh wrote:
> Seems like a simple fix. rpm-ostree should be modified to support file
> path rpms as well as
>
> rpm repositories. But will this work on a traditional rpm based system
> like RHEL or Fedora
>
> Workstation?
>
>
> On 11/18/2016 03:35 AM, Jakub Filak wrote:
>> I've been playing with privileged containers delivering services for D-Bus
>> system bus. These D-Bus services must be enabled by a configuration file
>> placed in the /etc/dbus-1/system.d/ directory. Therefore my containers must
>> install files on Atomic host and this action creates system files not owned
>> by any rpm package.
>>
>> Last week I wrote a script that creates an intermediate rpm package from
>> files in the /exports/hostfs/ directory in a container and installs the
>> package to a host [0]. Unfortunately, the script uses 'ostree admin unlock'
>> before running 'rpm -i ...', so my changes to rpm database disappear with
>> reboot. Using 'rpm-ostree pkg-add ...' could make the changes persistent but
>> the command does not accept local files.
>>
>> My question is that will it be possible to install local rpm files via
>> 'rpm-ostree pkg-add'?
>>
>>
>>
>> Jakub
>>
>> 0: https://github.com/jfilak/af
>>
>
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]