Merge pull request #591 from b-ehlers/master

Alpine packer updates
This commit is contained in:
Jeremy Grossmann 2021-05-25 18:57:45 -07:00 committed by GitHub
commit b9f10d5bc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 43 additions and 29 deletions

View 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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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