Move basic devel container setup into separate script for easier use
This commit is contained in:
parent
d8d4e8ca94
commit
c8813289e6
15
README.md
15
README.md
|
@ -121,19 +121,8 @@ for this purpose.
|
||||||
|
|
||||||
Here are some example commands how one might do that:
|
Here are some example commands how one might do that:
|
||||||
```
|
```
|
||||||
# create a directory to store builds and new container and start it
|
# do basic container setup
|
||||||
mkdir -p /hdd/build/container
|
containers/create-devel-container-example
|
||||||
podman container create -it \
|
|
||||||
--name archlinux-devel-container \ # give container a meaningful name
|
|
||||||
-v /hdd/cache/pacman/pkg:/var/cache/pacman/pkg \ # share pacman cache accross different containers
|
|
||||||
-v /hdd/build/container:/build \ # expose build directory to host
|
|
||||||
-v /hdd/projects:/src \ # access source files from host
|
|
||||||
-v /hdd/chroot/remote-config-x86_64:/cfg \ # mount directory containing pacman.conf/makepkg.conf
|
|
||||||
archlinux-base-devel
|
|
||||||
podman container start archlinux-devel-container
|
|
||||||
|
|
||||||
# configure pacman to use config from mounted directory
|
|
||||||
podman container exec archlinux-devel-container bash -c "$(cat devel/container/containersync)"
|
|
||||||
|
|
||||||
# start interactive shell in container
|
# start interactive shell in container
|
||||||
podman container exec -it archlinux-devel-container bash
|
podman container exec -it archlinux-devel-container bash
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
#!/bin/bash
|
||||||
|
dev_dir=/hdd
|
||||||
|
bindir=$(dirname "$0")
|
||||||
|
|
||||||
|
# create a directory to store builds and new container and start it
|
||||||
|
mkdir -p "$dev_dir/build/container"
|
||||||
|
|
||||||
|
# create container sharing pacman cache, chroot directory and build and source directory with host
|
||||||
|
podman container create -it \
|
||||||
|
--name archlinux-devel-container \
|
||||||
|
-v "$dev_dir/cache/pacman/pkg:/var/cache/pacman/pkg" \
|
||||||
|
-v "$dev_dir/build/container:/build" \
|
||||||
|
-v "$dev_dir/projects:/src" \
|
||||||
|
-v "$dev_dir/chroot/remote-config-x86_64:/cfg" \
|
||||||
|
archlinux-base-devel
|
||||||
|
|
||||||
|
# configure pacman to use config from mounted directory
|
||||||
|
podman container start archlinux-devel-container
|
||||||
|
podman container exec archlinux-devel-container bash -c "$(cat "$bindir/containersync")"
|
Loading…
Reference in New Issue