mirror of
https://github.com/GNS3/gns3-registry.git
synced 2024-12-30 09:38:52 +00:00
commit
b9f10d5bc1
34
packer/alpine-linux/files/docker-apk-build
Executable file
34
packer/alpine-linux/files/docker-apk-build
Executable file
@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
|
||||
package=$1
|
||||
version=$2
|
||||
if [ -z "$package" ]; then
|
||||
echo "Usage: docker-apk-build <package> [<alpine version>]" >&2
|
||||
exit 1
|
||||
fi
|
||||
[ -z "$version" ] && version="latest"
|
||||
|
||||
mkdir -p "$package"
|
||||
docker run --rm -i -v "$PWD/$package:/package" -e "package=$package" alpine:$version << 'EOF'
|
||||
apk add alpine-sdk
|
||||
|
||||
adduser -D builder
|
||||
addgroup builder abuild
|
||||
mkdir -p /var/cache/distfiles
|
||||
|
||||
su - builder << END_OF_SU
|
||||
mkdir -p .abuild
|
||||
echo 'PACKAGER="GNS3 Packer <packer@gns3-registry>"' > .abuild/abuild.conf
|
||||
abuild-keygen -a -n -q
|
||||
|
||||
git clone --depth 1 git://git.alpinelinux.org/aports
|
||||
cd aports/*/"$package"
|
||||
abuild -r
|
||||
END_OF_SU
|
||||
|
||||
alpine_version=$(cat /etc/alpine-release)
|
||||
alpine_version=${alpine_version%.*}
|
||||
mkdir -p "/package/${alpine_version}"
|
||||
cp -p /home/builder/packages/*/*/*.apk "/package/${alpine_version}"
|
||||
chown -R $(stat -c '%u:%g' /package) "/package/${alpine_version}"
|
||||
EOF
|
@ -1,20 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
alpine_version=3.12
|
||||
|
||||
mkdir -p "$alpine_version"
|
||||
docker run --rm -i -v "$PWD/$alpine_version:/package" alpine:$alpine_version << 'EOF'
|
||||
cd
|
||||
apk add alpine-sdk
|
||||
mkdir -p .abuild
|
||||
echo 'PACKAGER="GNS3 Packer <packer@gns3-registry>"' > .abuild/abuild.conf
|
||||
abuild-keygen -a -n -q
|
||||
|
||||
git clone --depth 1 git://git.alpinelinux.org/aports
|
||||
cd aports/*/ostinato
|
||||
abuild -F -r
|
||||
cd
|
||||
|
||||
cp -p packages/*/*/*.apk /package
|
||||
chown $(stat -c '%u:%g' /package) /package/*
|
||||
EOF
|
@ -42,13 +42,13 @@ sed -i -E '/zebra|bgp|ospf|rip|isis|pim|ldp|eigrp|static|bfd/ s/= *no/=yes/' /et
|
||||
echo "service integrated-vtysh-config" > /etc/frr/vtysh.conf
|
||||
chown frr:frr /etc/frr/vtysh.conf
|
||||
|
||||
# reset terminal modes
|
||||
sed -i "$(printf '1i\e[?5l\e[?7h\e[?8h')" /etc/motd
|
||||
|
||||
# run vtysh in .profile
|
||||
cat > /root/.profile << 'EOF'
|
||||
# ~/.profile: executed by Bourne-compatible login shells.
|
||||
|
||||
# reset terminal modes
|
||||
[ -t 1 ] && printf '\e[?5l\e[?7h\e[?8h'
|
||||
|
||||
if [ "$BASH" ]; then
|
||||
if [ -f ~/.bashrc ]; then
|
||||
. ~/.bashrc
|
||||
|
@ -40,13 +40,13 @@ setcap cap_net_admin,cap_net_raw=eip /usr/bin/drone
|
||||
addgroup user ostinato
|
||||
addgroup user wireshark
|
||||
|
||||
# reset terminal modes
|
||||
sed -i "$(printf '1i\e[?5l\e[?7h\e[?8h')" /etc/motd
|
||||
|
||||
# create .profile
|
||||
cat > /root/.profile << 'EOF'
|
||||
# ~/.profile: executed by Bourne-compatible login shells.
|
||||
|
||||
# reset terminal modes
|
||||
[ -t 1 ] && printf '\e[?5l\e[?7h\e[?8h'
|
||||
|
||||
if [ "$BASH" ]; then
|
||||
if [ -f ~/.bashrc ]; then
|
||||
. ~/.bashrc
|
||||
|
@ -1,13 +1,13 @@
|
||||
# install additional packages
|
||||
apk add nano busybox-extras
|
||||
|
||||
# reset terminal modes
|
||||
sed -i "$(printf '1i\e[?5l\e[?7h\e[?8h')" /etc/motd
|
||||
|
||||
# create .profile
|
||||
cat > /root/.profile << 'EOF'
|
||||
# ~/.profile: executed by Bourne-compatible login shells.
|
||||
|
||||
# reset terminal modes
|
||||
[ -t 1 ] && printf '\e[?5l\e[?7h\e[?8h'
|
||||
|
||||
if [ "$BASH" ]; then
|
||||
if [ -f ~/.bashrc ]; then
|
||||
. ~/.bashrc
|
||||
|
Loading…
Reference in New Issue
Block a user