Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new action to install a debian package #157

Open
fdanis-oss opened this issue Apr 12, 2019 · 7 comments · May be fixed by #220
Open

Add a new action to install a debian package #157

fdanis-oss opened this issue Apr 12, 2019 · 7 comments · May be fixed by #220

Comments

@fdanis-oss
Copy link

It could be useful to be able to install a locally built debian package to the image.

@elboulangero
Copy link
Contributor

For now I do it this way:

Create an overlay for your local packages:

DEBSDIR=overlays/debs/usr/local/debs

mkdir -p ${DEBSDIR:?}
cp <your-debs> ${DEBSDIR:?}
(cd ${DEBSDIR:?} && dpkg-scanpackages . /dev/null > Packages)

Add an apt sources file:

SOURCESDIR=overlays/debs/etc/apt/sources.list.d

mkdir -p ${SOURCESDIR:?}
echo 'deb [trusted=yes] file:///usr/local/debs/ ./' \
  > ${SOURCESDIR:?}/local.list

Then enable the overlay in the recipe:

vi recipe.yaml
----
  # Add local repository
  - action: overlay
    source: overlays/debs

It would be nice if debos could make it more seamless, for sure.

fdanis-oss added a commit to fdanis-oss/debos that referenced this issue May 29, 2019
fdanis-oss added a commit to fdanis-oss/debos that referenced this issue May 29, 2019
This add a new 'source' option to 'apt' action, allowing to install local
packages from the 'source' directory in addition to the repository.

Fix go-debos#157

Signed-off-by: Frédéric Danis <[email protected]>
fdanis-oss added a commit to fdanis-oss/debos that referenced this issue Jun 19, 2019
This add a new 'source' option to 'apt' action, allowing to install local
packages from the 'source' directory in addition to the repository.

Fix go-debos#157

Signed-off-by: Frédéric Danis <[email protected]>
fdanis-oss added a commit to fdanis-oss/debos that referenced this issue Aug 31, 2019
This add a new 'source' option to 'apt' action, allowing to install local
packages from the 'source' directory in addition to the repository.

Fix go-debos#157

Signed-off-by: Frédéric Danis <[email protected]>
@stappersg
Copy link
Contributor

@elboulangero please consider to document your workaround for a package install in a recipe for https://github.com/go-debos/debos-recipes

fdanis-oss added a commit to fdanis-oss/debos that referenced this issue Apr 28, 2020
This add a new 'local-packages-dir' option to 'apt' action, allowing to
install local packages from the 'local-packages-dir' directory in addition
to the repository.

Fix go-debos#157

Signed-off-by: Frédéric Danis <[email protected]>
obbardc added a commit to obbardc/debos that referenced this issue Jun 22, 2020
The apt-file action allows local .deb packages to be installed using the `apt`
command, much like the apt action but for local packages rather than those from
apt repositories.

Resolves: go-debos#157
Closes: go-debos#165

Signed-off-by: Christopher Obbard <[email protected]>
obbardc added a commit to obbardc/debos that referenced this issue Jun 22, 2020
…debian packages

The apt-file action allows local .deb packages to be installed using the `apt`
command, much like the apt action but for local packages rather than those from
apt repositories.

Resolves: go-debos#157
Closes: go-debos#165

Signed-off-by: Christopher Obbard <[email protected]>
obbardc added a commit to obbardc/debos that referenced this issue Jun 23, 2020
…debian packages

The apt-file action allows local .deb packages to be installed using the `apt`
command, much like the apt action but for local packages rather than those from
apt repositories.

Resolves: go-debos#157
Closes: go-debos#165

Signed-off-by: Christopher Obbard <[email protected]>
@sangorrin
Copy link
Contributor

@elboulangero @obbardc @sjoerdsimons

Is there a reason not to use the current actions as below?

  • action: download <-- alternatively, use the overlay action to get your custom debian package
    url: http://myserver/mypackage.deb

  • action: run
    chroot: true
    command: apt install -y ./mypackage.deb

  • action: run
    chroot: true
    command: rm ./mypackage.deb

Thanks,
Daniel

@obbardc
Copy link
Member

obbardc commented Jul 22, 2020

Hi Daniel,
This is just for convenience really - abstracts the workaround away.

@sangorrin
Copy link
Contributor

OK, in that case, it depends on the policy of Debos/Collabora.
I like abstracting by using the action "recipe" and variables.

@sjoerdsimons
Copy link
Member

debos wraps a lot of common recipes; e.g. the apt action you could do by run; even the debootstrap action can be done via a run action. So in general the debos policy is to try and provide convenient action for common actions to make it easier, typically we've done that after prototyping via other actions.. Easily installing a local package is one of those we've seen asked often (which you can do with recipes and have done in projects, but it's at least 3 actions which are error-prone and cumbersome)

@sangorrin
Copy link
Contributor

sangorrin commented Jul 28, 2020

Hi @sjoerdsimons

Thanks for your comment.

I think that adding convenient actions is nice, but I worry that adding too many could also increase your generous maintenance efforts.

In any case, have you considered adding a bit of syntax sugar to the apt action instead of creating a new one?

- action: apt
  recommends: bool
  unauthenticated: bool
  packages:
    - package3 <-- normal package from the apt repo
    - file://overlays/package1 <-- reuses the overlay action internally
    - https://debian.snapshots.com/xxx/mypackage2 <-- reuses the download action internally

Thanks,
Daniel

obbardc added a commit to obbardc/debos that referenced this issue Aug 14, 2020
…debian packages

The apt-file action allows local .deb packages to be installed using the `apt`
command, much like the apt action but for local packages rather than those from
apt repositories.

Resolves: go-debos#157
Closes: go-debos#165

Signed-off-by: Christopher Obbard <[email protected]>
obbardc added a commit to obbardc/debos that referenced this issue Jul 23, 2021
The apt-file action allows local .deb packages to be installed using the `apt`
command, much like the apt action but for local packages rather than those from
apt repositories.

Resolves: go-debos#157
Closes: go-debos#165

Signed-off-by: Christopher Obbard <[email protected]>
obbardc added a commit to obbardc/debos that referenced this issue Jul 27, 2023
The install-dpkg action allows local .deb packages to be installed using
the apt command, much like the apt action but for local packages rather
than for packages retrieved from remote apt repositories.

Resolves: go-debos#157
Closes: go-debos#165
Signed-off-by: Christopher Obbard <[email protected]>
obbardc added a commit to obbardc/debos that referenced this issue Jan 10, 2024
The install-dpkg action allows local .deb packages to be installed using
the apt command, much like the apt action but for local packages rather
than for packages retrieved from remote apt repositories.

Resolves: go-debos#157
Closes: go-debos#165
Signed-off-by: Christopher Obbard <[email protected]>
obbardc added a commit to obbardc/debos that referenced this issue Jan 10, 2024
The install-dpkg action allows local .deb packages to be installed using
the apt command, much like the apt action but for local packages rather
than for packages retrieved from remote apt repositories.

Resolves: go-debos#157
Closes: go-debos#165
Signed-off-by: Christopher Obbard <[email protected]>
obbardc added a commit to obbardc/debos that referenced this issue Jan 10, 2024
The install-dpkg action allows local .deb packages to be installed using
the apt command, much like the apt action but for local packages rather
than for packages retrieved from remote apt repositories.

Resolves: go-debos#157
Closes: go-debos#165
Signed-off-by: Christopher Obbard <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants