-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from iterait/aarch64
Add arch64 build
- Loading branch information
Showing
4 changed files
with
138 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
FROM scratch | ||
LABEL thanksto "archimg/archlinux" | ||
LABEL maintainer "Iterait a.s. <docker@iterait.com>" | ||
|
||
# add image content | ||
ADD arch-rootfs/ / | ||
ADD 99-cleanup.hook /usr/share/libalpm/hooks/ | ||
|
||
# add keyring | ||
RUN pacman-key --init && \ | ||
pacman-key --populate archlinuxarm | ||
|
||
# install base & remove useless stuff | ||
RUN pacman --noconfirm -Syu --needed \ | ||
base \ | ||
binutils \ | ||
fakeroot \ | ||
git \ | ||
sudo \ | ||
&& pacman --noconfirm -Rs \ | ||
dhcpcd \ | ||
nano \ | ||
netctl \ | ||
openresolv \ | ||
vi \ | ||
haveged \ | ||
net-tools \ | ||
openssh \ | ||
&& rm -rf /README | ||
|
||
# set UTF-8 locale | ||
RUN echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen && locale-gen | ||
RUN echo 'LANG=en_US.UTF-8' > /etc/locale.conf | ||
ENV LANG en_US.UTF-8 | ||
|
||
# setup user `aur` | ||
RUN useradd -m -s /bin/bash aur \ | ||
&& passwd -d aur \ | ||
&& echo 'aur ALL=(ALL) ALL' > /etc/sudoers.d/aur \ | ||
&& echo 'Defaults env_keep += "EDITOR"' >> /etc/sudoers.d/aur | ||
|
||
|
||
# remove all unnecessary packages | ||
RUN pacman --noconfirm -R \ | ||
git \ | ||
argon2 \ | ||
base \ | ||
binutils \ | ||
cryptsetup \ | ||
db \ | ||
dbus \ | ||
device-mapper \ | ||
diffutils \ | ||
elfutils \ | ||
fakeroot \ | ||
file \ | ||
gawk \ | ||
gdbm \ | ||
gettext \ | ||
grep \ | ||
hwids \ | ||
icu \ | ||
iproute2 \ | ||
iptables \ | ||
iputils \ | ||
json-c \ | ||
kbd \ | ||
kmod \ | ||
libcroco \ | ||
libelf \ | ||
libmnl \ | ||
libnetfilter_conntrack \ | ||
libnfnetlink \ | ||
libnftnl \ | ||
libnl \ | ||
libpcap \ | ||
libseccomp \ | ||
libxml2 \ | ||
licenses \ | ||
linux-aarch64 \ | ||
linux-firmware \ | ||
mkinitcpio \ | ||
mkinitcpio-busybox \ | ||
mpfr \ | ||
pciutils \ | ||
perl \ | ||
perl-error \ | ||
perl-mailtools \ | ||
perl-timedate \ | ||
popt \ | ||
procps-ng \ | ||
psmisc \ | ||
shadow \ | ||
sudo \ | ||
systemd \ | ||
systemd-sysvcompat \ | ||
tar \ | ||
util-linux \ | ||
which | ||
|
||
CMD ["/bin/bash"] |
3 changes: 2 additions & 1 deletion
3
.../archlinuxarm/Dockerfile.archlinuxarm-dev → dockerfiles/archlinuxarm/Dockerfile.dev
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,37 @@ | ||
#!/bin/bash -ex | ||
|
||
[ $UID -ne 0 ] && echo "This script should get executed as root. Otherwise file special permissions are not set correctly." >&2 | ||
|
||
URL="http://os.archlinuxarm.org/os" | ||
IMAGE_TAR="ArchLinuxARM-rpi-2-latest.tar.gz" | ||
TODAY="$(date '+%Y-%m-%d')" | ||
URL="http://os.archlinuxarm.org/os" | ||
|
||
for imagename in archlinuxaarch64 archlinuxarm; do | ||
|
||
if [ "${imagename}" = "archlinuxarm" ]; then | ||
IMAGE_TAR="ArchLinuxARM-rpi-2-latest.tar.gz" | ||
elif [ "${imagename}" = "archlinuxaarch64" ]; then | ||
IMAGE_TAR="ArchLinuxARM-aarch64-latest.tar.gz" | ||
else | ||
echo "Not suppoorted arm image type." | ||
exit 1 | ||
fi | ||
|
||
# Download and unpack the base system tarball from archlinuxarm.org. | ||
rm -rf "${IMAGE_TAR}" arch-rootfs | ||
wget "${URL}/${IMAGE_TAR}" | ||
mkdir -p arch-rootfs | ||
tar -xzf ${IMAGE_TAR} --strip-components=1 --directory=./arch-rootfs | ||
# Download and unpack the base system tarball from archlinuxarm.org. | ||
rm -rf "${IMAGE_TAR}" arch-rootfs | ||
wget "${URL}/${IMAGE_TAR}" | ||
mkdir -p arch-rootfs | ||
tar -xzf ${IMAGE_TAR} --strip-components=1 --directory=./arch-rootfs | ||
|
||
# Copy libalpm hooks to our future build context | ||
cp ../*.hook ./ | ||
# Copy libalpm hooks to our future build context | ||
cp ../*.hook ./ | ||
|
||
# Build the base image. | ||
docker build -f Dockerfile.archlinuxarm --rm --no-cache -t "iterait/archlinuxarm:${TODAY}" -t "iterait/archlinuxarm:latest" --squash . | ||
# Build the -dev version without context. | ||
docker build - --rm --no-cache -t "iterait/archlinuxarm-dev:${TODAY}" -t "iterait/archlinuxarm-dev:latest" < Dockerfile.archlinuxarm-dev | ||
# Build the base image. | ||
docker build -f Dockerfile.${imagename} --rm --no-cache -t "iterait/${imagename}:${TODAY}" -t "iterait/${imagename}:latest" --squash . | ||
# Build the -dev version without context. | ||
docker build - --build-arg BASE_IMAGE=${imagename} --rm --no-cache -t "iterait/${imagename}-dev:${TODAY}" -t "iterait/${imagename}-dev:latest" < Dockerfile.dev | ||
|
||
# Push the images to the repository. | ||
docker push iterait/archlinuxarm:latest | ||
docker push iterait/archlinuxarm:${TODAY} | ||
docker push iterait/archlinuxarm-dev:latest | ||
docker push iterait/archlinuxarm-dev:${TODAY} | ||
# Push the images to the repository. | ||
docker push iterait/${imagename}:latest | ||
docker push iterait/${imagename}:${TODAY} | ||
docker push iterait/${imagename}-dev:latest | ||
docker push iterait/${imagename}-dev:${TODAY} | ||
done |