新增Docker构建amd64镜像

master
iyuu.cn 5 years ago
parent 8813afbd73
commit f78e9c737c
  1. 104
      docker/AMD64/Dockerfile
  2. 4
      docker/AMD64/build.sh
  3. 21
      docker/Arm64v8/Dockerfile
  4. 4
      docker/Arm64v8/build.n1.sh
  5. 4
      docker/Arm64v8/build.sh
  6. 2
      docker/Arm64v8/iyuu.sh
  7. 3
      docker/Arm64v8/task.sh
  8. 14
      docker/Dockerfile
  9. 9
      docker/build.sh
  10. 10
      docker/entrypoint.sh
  11. 3
      docker/iyuu.sh
  12. 8
      docker/n1.sh
  13. 3
      docker/task.sh

@ -0,0 +1,104 @@
FROM swoft/alphp:base
#FROM arm64v8/alpine:latest
#FROM arm64v8/alpine:3.12
LABEL maintainer="david <367013672@qq.com>" version="1.0"
##
# ---------- env settings ----------
##
# --build-arg timezone=Asia/Shanghai
ARG timezone
# prod pre test dev
ARG app_env=prod
# default use www-data user
# ARG add_user=www-data
ENV APP_ENV=${app_env:-"prod"} \
TIMEZONE=${timezone:-"Asia/Shanghai"}
##
# ---------- building ----------
##
RUN set -ex \
# change apk source repo
&& sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/' /etc/apk/repositories \
&& apk update \
&& apk add --no-cache \
# Install base packages ('ca-certificates' will install 'nghttp2-libs')
# ca-certificates \
# curl \
# tar \
# xz \
# libressl \
# openssh \
# openssl \
git \
tzdata \
# pcre \
# install php7 and some extensions
php7 \
# php7-common \
# php7-bcmath \
php7-curl \
# php7-ctype \
php7-dom \
# php7-fileinfo \
# php7-gettext \
# php7-gd \
# php7-iconv \
# php7-imagick \
php7-json \
php7-mbstring \
#php7-mongodb \
# php7-mysqlnd \
# php7-openssl \
# php7-opcache \
# php7-pdo \
# php7-pdo_mysql \
# php7-pdo_sqlite \
# php7-phar \
# php7-posix \
# php7-redis \
php7-simplexml \
# php7-sockets \
# php7-sodium \
# php7-sqlite \
# php7-session \
# php7-sysvshm \
# php7-sysvmsg \
# php7-sysvsem \
# php7-tokenizer \
php7-zip \
# php7-zlib \
php7-xml \
&& git clone https://gitee.com/ledc/IYUUAutoReseed.git /var/www \
&& cp /var/www/config/config.sample.php /var/www/config/config.php \
&& ln -sf /var/www/config/config.php /config.php \
&& apk del --purge *-dev \
&& rm -rf /var/cache/apk/* /tmp/* /usr/share/man /usr/share/php7 \
# ---------- some config,clear work ----------
&& cd /etc/php7 \
# - config PHP
&& { \
echo "upload_max_filesize=100M"; \
echo "post_max_size=108M"; \
echo "memory_limit=1024M"; \
echo "date.timezone=${TIMEZONE}"; \
} | tee conf.d/99-overrides.ini \
# - config timezone
&& ln -sf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime \
&& echo "${TIMEZONE}" > /etc/timezone \
# ---------- some config work ----------
# - ensure 'www-data' user exists(82 is the standard uid/gid for "www-data" in Alpine)
# && addgroup -g 82 -S ${add_user} \
# && adduser -u 82 -D -S -G ${add_user} ${add_user} \
# # - create user dir
# && mkdir -p /data \
# && chown -R ${add_user}:${add_user} /data \
&& echo -e "\033[42;37m Build Completed :).\033[0m\n"
EXPOSE 9000
# VOLUME ["/var/www", "/data"]
WORKDIR /var/www

@ -0,0 +1,4 @@
#!/bin/sh
docker build -t iyuu:latest .
docker run -it -v /root/config.php:/config.php --network bridge --name IYUUAutoReseed --restart always -d iyuu:latest
docker exec -it IYUUAutoReseed php iyuu.php

@ -1,16 +1,21 @@
#FROM alpine:latest
FROM arm64v8/alpine
#FROM arm64v8/alpine:latest
#FROM arm64v8/alpine:3.12
ENV TZ Asia/Shanghai
ENV cron="0 9 * * 0"
RUN set -ex \
&& sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/' /etc/apk/repositories \
&& apk --update add --no-cache tzdata php7 php7-curl php7-json php7-mbstring git \
# && sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.cn/' /etc/apk/repositories \
&& apk --update add --no-cache \
tzdata \
php7 php7-curl php7-json php7-mbstring php7-dom php7-simplexml php7-xml php7-zip \
git \
&& git clone https://gitee.com/ledc/IYUUAutoReseed.git /IYUU \
&& cp /IYUU/config/config.sample.php /IYUU/config/config.php \
&& ln -sf /IYUU/config/config.php /config.php
ENV TZ Asia/Shanghai
ENV cron="0 9 * * 0"
&& ln -sf /IYUU/config/config.php /config.php \
&& echo "${TZ}" > /etc/timezone \
&& ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime
WORKDIR /IYUU
CMD ["sh", "-c", "/usr/bin/php /IYUU/iyuu.php ; /usr/sbin/crond ; (crontab -l ;echo \"$cron /usr/bin/php /IYUU/iyuu.php &> /dev/null\") | crontab - ; tail -f /dev/null"]

@ -0,0 +1,4 @@
#!/bin/sh
docker build -t iyuu:latest .
docker run -it -v /root/config.php:/config.php -v /var/lib/transmission/torrents:/torrents -v /var/lib/qbittorrent/.local/share/data/qBittorrent/BT_backup:/BT_backup --network bridge --name IYUUAutoReseed --restart always -d iyuu:latest
docker exec -it IYUUAutoReseed php iyuu.php

@ -1,4 +1,4 @@
#!/bin/sh
docker build -t iyuu:latest .
docker run -it -v /root/config.php:/config.php -v /var/lib/transmission/torrents:/torrents -v /var/lib/qbittorrent/.local/share/data/qBittorrent/BT_backup:/BT_backup --network bridge --name IYUUAutoReseed --restart always -d iyuu:latest
docker build -f Dockerfile -t iyuu:latest .
docker run -it -v /root/config.php:/config.php --network bridge --name IYUUAutoReseed --restart always -d iyuu:latest
docker exec -it IYUUAutoReseed php iyuu.php

@ -1,3 +1,3 @@
#!/bin/sh
export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin
docker exec -it IYUUAutoReseed php iyuu.php
docker exec IYUUAutoReseed php iyuu.php

@ -1,3 +0,0 @@
#!/bin/sh
export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin
docker exec IYUUAutoReseed php iyuu.php

@ -1,14 +0,0 @@
FROM composer:1.10.9
ENV TZ Asia/Shanghai
ENV cron="0 */1 * * *"
COPY . /IYUU
COPY ./docker/entrypoint.sh /entrypoint.sh
WORKDIR /IYUU
RUN apk add --no-cache bash tzdata \
&& composer i
ENTRYPOINT [ "/entrypoint.sh" ]

@ -1,9 +0,0 @@
#!/bin/sh
cd /root
wget -c https://gitee.com/ledc/IYUUAutoReseed/repository/archive/master.zip -O IYUUAutoReseed.zip
unzip -o ./IYUUAutoReseed.zip -d /root
rm ./IYUUAutoReseed.zip
cd /root/IYUUAutoReseed/docker
chmod +x ./*.sh
docker build -t iyuu:latest .
docker run -it -v /root/IYUUAutoReseed:/IYUU -p 8510:9000 --network bridge --name IYUUAutoReseed --restart always -d iyuu:latest

@ -1,10 +0,0 @@
#!/bin/bash
DEFAULT_CRON="0 */1 * * *"
cron=${cron:-$DEFAULT_CRON}
set -e
echo "$cron /usr/local/bin/php /IYUU/iyuu.php" | crontab -
/usr/local/bin/php /IYUU/iyuu.php
/usr/sbin/crond -f

@ -1,3 +0,0 @@
#!/bin/sh
export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin
docker exec -it IYUUAutoReseed php iyuu.php

@ -1,8 +0,0 @@
#!/bin/sh
cd /root
git clone https://gitee.com/ledc/IYUUAutoReseed.git
cd /root/IYUUAutoReseed/docker
chmod +x ./*.sh
docker build -t iyuu:latest .
docker run -it -v /root/IYUUAutoReseed:/IYUU -v /var/lib/qbittorrent/.local/share/data/qBittorrent/BT_backup:/BT_backup -p 8510:9000 --network bridge --name IYUUAutoReseed --restart always -d iyuu:latest
./iyuu.sh

@ -1,3 +0,0 @@
#!/bin/sh
export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin
docker exec IYUUAutoReseed php iyuu.php
Loading…
Cancel
Save