wget https://github.com/dotnetcore/FastGithub/releases/download/2.0.4/fastgithub_linux-x64.zip
在展开的目录中,编写Dockerfile
FROM ubuntu:18.04
LABEL MAINTAINER=slcnx
RUN apt update && apt install libicu-dev libgssapi-krb5-2 libssl-dev -y --fix-missing && \
apt install -y locales && rm -rf /var/lib/apt/lists/* && localedef -i zh_CN -c -f UTF-8 -A /usr/share/locale/locale.alias zh_CN.UTF-8
ENV LANG zh_CN.utf8
ADD . /fastgithub/
EXPOSE 38457
CMD /fastgithub/fastgithub
version: "3.7"
services:
fastgithub:
image: slcnx/fastgithub
network_mode: host
restart: always
volumes:
- cacert:/fastgithub/cacert/
sample:
depends_on:
- fastgithub
image: slcnx/ubuntu:18.04
volumes:
- cacert:/tmp/cacert
working_dir: /hugo_data
restart: on-failure
tty: true
entrypoint: sh -c 'cp /tmp/cacert/fastgithub.cer /usr/local/share/ca-certificates/fastgithub.crt && update-ca-certificates && cat'
command: ""
environment:
https_proxy: http://127.0.0.1:38457
http_proxy: http://127.0.0.1:38457
network_mode: host
volumes:
cacert: {}
network_mode主机模式,为了可以多个容器可以通过localhost通信。 一般只需要拉github.com仓库的镜像才需要工作于hostdepends_on拉代码的主机肯定后于fastgithub运行volumes这个是将fastgithub生成的cacert通过卷在多个容器间共享entrypoint这个是将fastgithub中的cacert证书,加载到自己的linux主机。update-ca-certificates -d会扫描/usr/share/ca-certificates下的*.crt文件。或者不加-d会扫描/usr/local/share/ca-certificates下的*.crt文件。restart: on-failure当脚本退出码非0,就重来,是0,正常结束,就OK
运行
docker-compose up --remove-orphans
Content type
Image
Digest
Size
200.2 MB
Last updated
almost 5 years ago
docker pull slcnx/fastgithub