Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
1125e053
Unverified
Commit
1125e053
authored
Feb 21, 2016
by
Jakub Jirutka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lxc-alpine: allow to install additional packages
Signed-off-by:
Jakub Jirutka
<
jakub@jirutka.cz
>
parent
20f39db7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
lxc-alpine.in
templates/lxc-alpine.in
+16
-7
No files found.
templates/lxc-alpine.in
View file @
1125e053
...
...
@@ -67,7 +67,9 @@ usage() {
cat
<<-
EOF
Template specific options can be passed to lxc-create after a '--' like this:
lxc-create --name=NAME [lxc-create-options] -- [template-options]
lxc-create --name=NAME [lxc-create-options] -- [template-options] [PKG...]
PKG Additional APK package(s) to install into the container.
Template options:
-a ARCH, --arch=ARCH The container architecture (e.g. x86, x86_64); defaults
...
...
@@ -230,6 +232,7 @@ install() {
local
dest
=
"
$1
"
local arch
=
"
$2
"
local
branch
=
"
$3
"
local
extra_packages
=
"
$4
"
local
apk_cache
=
"
$LXC_CACHE_DIR
/apk/
$arch
"
local
repo_url
=
"
$MIRROR_URL
/
$branch
/main"
...
...
@@ -244,13 +247,9 @@ install() {
mkdir
-p
etc/apk
ln
-s
"
$apk_cache
"
etc/apk/cache
$APK
--update-cache
--initdb
--arch
=
"
$arch
"
\
--root
=
.
--keys-dir
=
"
$APK_KEYS_DIR
"
--repository
=
"
$repo_url
"
\
add alpine-base
echo
"
$repo_url
"
>
etc/apk/repositories
install_packages
"
$arch
"
alpine-base
$extra_packages
make_dev_nodes
setup_inittab
setup_hosts
...
...
@@ -264,6 +263,14 @@ install() {
cd
-
>
/dev/null
}
install_packages
()
{
local arch
=
"
$1
"
;
shift
local
packages
=
"
$@
"
$APK
--arch
=
"
$arch
"
--root
=
.
--keys-dir
=
"
$APK_KEYS_DIR
"
\
--update-cache
--initdb
add
$packages
}
make_dev_nodes
()
{
mkdir
-p
-m
755 dev/pts
mkdir
-p
-m
1777 dev/shm
...
...
@@ -454,6 +461,8 @@ while [ $# -gt 0 ]; do
esac
done
extra_packages
=
"
$@
"
[
"
$debug
"
=
'yes'
]
&&
set
-x
# Set global variables.
...
...
@@ -482,7 +491,7 @@ fi
# Here we go!
run_exclusively
'bootstrap'
10 bootstrap
run_exclusively
"
$arch
"
30
install
"
$rootfs
"
"
$arch
"
"
$release
"
run_exclusively
"
$arch
"
30
install
"
$rootfs
"
"
$arch
"
"
$release
"
"
$extra_packages
"
configure_container
"
$path
/config"
"
$name
"
"
$arch
"
einfo
"Container's rootfs and config have been created"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment