Subject: [alpine-user] shared apk cache

From: Alex Athanasopoulos <[email-masked]>
Date: Thu, 17 Jan 2019 14:10:20 +0200

Is it safe to use an /etc/apk/cache directory that is shared across
multiple Alpine Linux systems with the same version?

I use Alpine containers on LXD.

I just started using them with a shared /etc/cache/apk as follows, and
it seems to work fine:

One-time setup (using snap lxd 3.9 on Ubuntu):

    lxc storage volume create default alpine38-apk

    lxc profile copy default alpine38

    lxc storage volume attach-profile default alpine38-apk alpine38
/etc/apk/cache

Then create alpine/3.8 containers like this:

    lxc launch images:alpine/3.8 a1 -p alpine38

    lxc launch images:alpine/3.8 a2 -p alpine38

The resulting containers a1, a2 have read/write permission on the same
volume, which is mounted on /etc/apk/cache.

When alpine/3.9 is released, I'll make a new shared volume alpine39-apk,
so as not to mix different versions with the same cache.

Reference:

https://wiki.alpinelinux.org/wiki/Local_APK_cache

- Alex

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Léo El Amri <[email-masked]>
Date: Thu, 17 Jan 2019 13:19:17 +0100

I recently looked-up the code related to caching. I'd say it's safe to
"sequentially" use a common cache for the same Alpine version.

Your method for sharing it is right.

---

---

From: PICCORO McKAY Lenz <[email-masked]>
Date: Thu, 17 Jan 2019 08:37:29 -0400

> multiple Alpine Linux systems with the same version?
as i know, the index and packages to take will be "controled" by the index
of the repository so.. if in the cache directory we have two versions only
those registered by the index repository loaded will be taken and make
effect!

> I use Alpine containers on LXD.
was a great idea, can you make a wiki page about it? seems wiki NEED A LOVE!

> I just started using them with a shared /etc/cache/apk as follows, and
on same versions or differents versions of alpine? more than one.?
i guess if two alpine version close will not have too much conflicts.. but
as i said in firts.. there's no techincally problems

---

From: Alex Athanasopoulos <[email-masked]>
Date: Thu, 17 Jan 2019 14:44:25 +0200

I have made a wiki page about how to use Alpine containers on LXD:

https://wiki.alpinelinux.org/wiki/Install_Alpine_on_LXD