Docker Compose 存放在Git Hub,不太稳定。 你可以也通过执行下面的命令,高速安装Docker Compose。
curl -L https://get.daocloud.io/docker/compose/releases/download/1.23.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| # This script to install Kubernetes will get executed after we have provisioned the box | |
| $script = <<-SCRIPT | |
| apt-get update | |
| apt-get install -y docker.io docker-compose python | |
| curl -s https://storage.googleapis.com/harbor-releases/release-1.7.0/harbor-online-installer-v1.7.1.tgz | tar zxv | |
| cd harbor |
| #!/bin/sh | |
| CA_PASS="1234" | |
| SERVER_PASS="4321" | |
| CLIENT_PASS="5678" | |
| ###################### Server ###################### | |
| # Generate CA key: | |
| openssl genrsa -des3 -out ca.key -passout pass:$CA_PASS 4096 |
| FROM node:alpine | |
| ENV LANG=C.UTF-8 | |
| # Here we install GNU libc (aka glibc) and set C.UTF-8 locale as default. | |
| RUN ALPINE_GLIBC_BASE_URL="https://github.com/sgerrand/alpine-pkg-glibc/releases/download" && \ | |
| ALPINE_GLIBC_PACKAGE_VERSION="2.26-r0" && \ | |
| ALPINE_GLIBC_BASE_PACKAGE_FILENAME="glibc-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \ | |
| ALPINE_GLIBC_BIN_PACKAGE_FILENAME="glibc-bin-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \ |
| # I | |
| docker container run -itd --name nginx1 -p 8081:80 nginx:1.17.6 && \ | |
| docker container run -itd --name nginx2 -p 8082:80 nginx:1.17.6 | |
| # II | |
| for i in "nginx1" "nginx2"; do | |
| docker container exec -it $i /bin/sh -c 'sed -i "s#deb.debian.org#mirrors.aliyun.com#g" /etc/apt/sources.list && sed -i "s#security.debian.org#mirrors.aliyun.com#g" /etc/apt/sources.list && apt-get clean && apt-get update && apt-get -y upgrade && apt-get install -y curl iproute2 ncat iputils-ping' | |
| done |
| # インスタンスを立てるときに marketplace から nvidia で検索して Amazon Linux AMI with NVIDIA GRID GPU Driver を入れる | |
| # docker を入れる | |
| sudo yum install -y docker | |
| sudo /etc/init.d/docker start | |
| # nvidia-docker を入れる | |
| wget -P /tmp https://github.com/NVIDIA/nvidia-docker/releases/download/v1.0.0-rc.3/nvidia-docker-1.0.0.rc.3-1.x86_64.rpm | |
| # systemd に依存しているので依存を無視する | |
| sudo rpm -ihv /tmp/nvidia-docker-1.0.0.rc.3-1.x86_64.rpm --nodeps |
Copy locale.md file below into same directory as your Dockerfile
FROM alpine:3.9
# Install language pack
RUN apk --no-cache add ca-certificates wget && \
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.25-r0/glibc-2.25-r0.apk && \| CHECK PROCESS elasticsearch WITH MATCHING "org.elasticsearch.bootstrap.Elasticsearch" | |
| CHECK PROGRAM elasticsearch_container WITH PATH "/usr/bin/docker top elasticsearch" | |
| if status != 0 then alert | |
| alert warning@cinhtau.net | |
| group elkstack | |
| CHECK HOST elasticsearch_healthcheck WITH ADDRESS cinhtau.net | |
| if failed url http://cinhtau.net:9200 for 5 cycles | |
| then alert | |
| alert warning@cinhtau.net BUT not on { action, instance } | |
| depends on elasticsearch_container |