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
50de2834
Commit
50de2834
authored
Mar 14, 2017
by
Christian Brauner
Committed by
GitHub
Mar 14, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1461 from jirutka/alpine
lxc-alpine: few modifications
parents
d32e7cd7
72ead1c0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
lxc-alpine.in
templates/lxc-alpine.in
+7
-10
No files found.
templates/lxc-alpine.in
View file @
50de2834
...
@@ -46,7 +46,7 @@ ebf31683b56410ecc4c00acd9f6e2839e237a3b62b5ae7ef686705c7ba0396a9 alpine-devel@l
...
@@ -46,7 +46,7 @@ ebf31683b56410ecc4c00acd9f6e2839e237a3b62b5ae7ef686705c7ba0396a9 alpine-devel@l
12f899e55a7691225603d6fb3324940fc51cd7f133e7ead788663c2b7eecb00c alpine-devel@lists.alpinelinux.org-5261cecb.rsa.pub"
12f899e55a7691225603d6fb3324940fc51cd7f133e7ead788663c2b7eecb00c alpine-devel@lists.alpinelinux.org-5261cecb.rsa.pub"
readonly
APK_KEYS_URI
=
'http://alpinelinux.org/keys'
readonly
APK_KEYS_URI
=
'http://alpinelinux.org/keys'
readonly
MIRRORS_LIST_URL
=
'http://rsync.alpinelinux.org/alpine/MIRRORS.txt
'
readonly
DEFAULT_MIRROR_URL
=
'http://dl-cdn.alpinelinux.org/alpine
'
:
${
APK_KEYS_DIR
:
=/etc/apk/keys
}
:
${
APK_KEYS_DIR
:
=/etc/apk/keys
}
if
!
ls
"
$APK_KEYS_DIR
"
/alpine
*
>
/dev/null 2>&1
;
then
if
!
ls
"
$APK_KEYS_DIR
"
/alpine
*
>
/dev/null 2>&1
;
then
...
@@ -76,7 +76,7 @@ usage() {
...
@@ -76,7 +76,7 @@ usage() {
to the host arch.
to the host arch.
-d, --debug Run this script in a debug mode (set -x and wget w/o -q).
-d, --debug Run this script in a debug mode (set -x and wget w/o -q).
-F, --flush-cache Remove cached files before build.
-F, --flush-cache Remove cached files before build.
-m URL --mirror=URL The Alpine mirror to use; defaults to
random mirror
.
-m URL --mirror=URL The Alpine mirror to use; defaults to
$DEFAULT_MIRROR_URL
.
-r VER, --release=VER The Alpine release branch to install; default is the
-r VER, --release=VER The Alpine release branch to install; default is the
latest stable.
latest stable.
...
@@ -130,11 +130,6 @@ parse_arch() {
...
@@ -130,11 +130,6 @@ parse_arch() {
esac
esac
}
}
random_mirror_url
()
{
local
url
=
$(
fetch
"
$MIRRORS_LIST_URL
"
|
shuf
-n
1
)
[
-n
"
$url
"
]
&&
echo
"
$url
"
}
run_exclusively
()
{
run_exclusively
()
{
local
lock_name
=
"
$1
"
local
lock_name
=
"
$1
"
local timeout
=
$2
local timeout
=
$2
...
@@ -236,7 +231,6 @@ install() {
...
@@ -236,7 +231,6 @@ install() {
local
branch
=
"
$3
"
local
branch
=
"
$3
"
local
extra_packages
=
"
$4
"
local
extra_packages
=
"
$4
"
local
apk_cache
=
"
$LXC_CACHE_DIR
/apk/
$arch
"
local
apk_cache
=
"
$LXC_CACHE_DIR
/apk/
$arch
"
local
repo_url
=
"
$MIRROR_URL
/
$branch
/main"
if
[
"
$FLUSH_CACHE
"
=
'yes'
]
&&
[
-d
"
$apk_cache
"
]
;
then
if
[
"
$FLUSH_CACHE
"
=
'yes'
]
&&
[
-d
"
$apk_cache
"
]
;
then
einfo
"Cleaning cached APK packages for
$arch
"
einfo
"Cleaning cached APK packages for
$arch
"
...
@@ -249,7 +243,10 @@ install() {
...
@@ -249,7 +243,10 @@ install() {
mkdir
-p
etc/apk
mkdir
-p
etc/apk
ln
-s
"
$apk_cache
"
etc/apk/cache
ln
-s
"
$apk_cache
"
etc/apk/cache
echo
"
$repo_url
"
>
etc/apk/repositories
local
repo
;
for
repo
in
main community
;
do
echo
"
$MIRROR_URL
/
$branch
/
$repo
"
>>
etc/apk/repositories
done
install_packages
"
$arch
"
"alpine-base
$extra_packages
"
install_packages
"
$arch
"
"alpine-base
$extra_packages
"
make_dev_nodes
make_dev_nodes
...
@@ -475,7 +472,7 @@ extra_packages="$@"
...
@@ -475,7 +472,7 @@ extra_packages="$@"
# Set global variables.
# Set global variables.
readonly
DEBUG
=
"
$debug
"
readonly
DEBUG
=
"
$debug
"
readonly
FLUSH_CACHE
=
"
$flush_cache
"
readonly
FLUSH_CACHE
=
"
$flush_cache
"
readonly
MIRROR_URL
=
"
${
mirror_url
:-$
(
random_mirror_url
)
}
"
readonly
MIRROR_URL
=
"
${
mirror_url
:-
$
DEFAULT_MIRROR_URL
}
"
# Validate options.
# Validate options.
[
-n
"
$name
"
]
||
die 1
'Missing required option --name'
[
-n
"
$name
"
]
||
die 1
'Missing required option --name'
...
...
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