From 4621bb88bee0f76d889f29492840244bed016e6b Mon Sep 17 00:00:00 2001 From: Kuoi Date: Wed, 20 Jul 2022 01:15:04 +0100 Subject: [PATCH] init --- Dockerfile | 19 +++++++++++++++++++ README.md | 33 +++++++++++++++++++++++++++++++++ dockerhub.service | 8 ++++++++ dockerhub.timer | 9 +++++++++ gen_docker.sh | 8 ++++++++ man_docker.sh | 7 +++++++ 6 files changed, 84 insertions(+) create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 dockerhub.service create mode 100644 dockerhub.timer create mode 100755 gen_docker.sh create mode 100755 man_docker.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..eaf8e2e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM archlinux:latest + +# import bioarchlinux keyring +RUN pacman -Syu --noconfirm +RUN pacman-key --recv-keys B1F96021DB62254D +RUN pacman-key --finger B1F96021DB62254D +RUN pacman-key --init +RUN pacman-key --lsign-key B1F96021DB62254D + +# add bioarchlinux to pacman.conf +RUN curl https://raw.githubusercontent.com/BioArchLinux/mirror/main/pacman.conf.bio -o /etc/pacman.conf +RUN curl https://raw.githubusercontent.com/BioArchLinux/mirror/main/mirrorlist.bio -o /etc/pacman.d/mirrorlist.bio +RUN sed -i '2,2s/# //g' /etc/pacman.d/mirrorlist.bio + +# install keyring and mirrorlist packages +RUN pacman -Syu --noconfirm +RUN pacman -S --noconfirm bioarchlinux-keyring +RUN pacman -S --noconfirm --overwrite '*' bioarchlinux-mirrorlist +RUN rm -rf /var/cache/pacman/pkg diff --git a/README.md b/README.md new file mode 100644 index 0000000..7d0c37b --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +# BioArchLinux on Docker + +## Install docker and pull image + +Install [docker](https://www.docker.com/) and start it + +``` +docker pull bioarchlinux/bioarchlinux +docker run -it --name container_name bioarchlinux/bioarchlinux +``` + +## Choose mirror +then you need to choose a mirror of archlinux and bioarchlinux + +choose mirror of archlinux from [here](https://archlinux.org/mirrorlist/) and run the following command ( take sdu mirror as the example) + +``` +echo 'Server = https://mirrors.sdu.edu.cn/archlinux/$repo/os/$arch' > /etc/pacman.d/mirrorlist +``` + +choose mirror bioarchlinux from [here](https://raw.githubusercontent.com/BioArchLinux/mirror/main/mirrorlist.bio) and run the following command ( take sdu mirror as the example) + +``` +echo 'Server = https://mirrors.sdu.edu.cn/bioarchlinux/$arch' > /etc/pacman.d/mirrorlist.bio +``` + +## Use it + +Finally, you can install any packages from BioArchLinux +``` +pacman -Syu +pacman -S foo +``` diff --git a/dockerhub.service b/dockerhub.service new file mode 100644 index 0000000..c08b48e --- /dev/null +++ b/dockerhub.service @@ -0,0 +1,8 @@ +[Unit] +Description=docker updater +Wants=dockerhub.timer + +[Service] +User=root +Type=simple +ExecStart=/usr/share/lilac/docker/man_docker.sh diff --git a/dockerhub.timer b/dockerhub.timer new file mode 100644 index 0000000..333a40b --- /dev/null +++ b/dockerhub.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Runs docker updater everyday + +[Timer] +OnCalendar=*-*-* 02:00:00 +Unit=dockerhub.service + +[Install] +WantedBy=multi-user.target diff --git a/gen_docker.sh b/gen_docker.sh new file mode 100755 index 0000000..4c21a67 --- /dev/null +++ b/gen_docker.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +docker build -t bioarchlinux:$(date "+%Y%m%d") . +docker tag bioarchlinux:$(date "+%Y%m%d") bioarchlinux/bioarchlinux:$(date "+%Y%m%d") +docker tag bioarchlinux:$(date "+%Y%m%d") bioarchlinux/bioarchlinux:latest +docker push bioarchlinux/bioarchlinux:$(date "+%Y%m%d") -a + +docker rmi --force $(docker images -q) diff --git a/man_docker.sh b/man_docker.sh new file mode 100755 index 0000000..f57fb54 --- /dev/null +++ b/man_docker.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +cd /usr/share/lilac/docker + +git pull + +./gen_docker.sh