From 9cfd1fda2b6dfb3a75639120616225f7bdb0bb0c Mon Sep 17 00:00:00 2001 From: Kang Huaishuai Date: Tue, 28 Apr 2020 23:26:55 +0800 Subject: [PATCH] offline read docker image add tips Signed-off-by: Kang Huaishuai --- .docker/docker-entrypoint.sh | 9 +++++++++ .github/workflows/ci.yaml | 3 +++ .travis.yml | 3 +++ 3 files changed, 15 insertions(+) create mode 100644 .docker/docker-entrypoint.sh diff --git a/.docker/docker-entrypoint.sh b/.docker/docker-entrypoint.sh new file mode 100644 index 0000000..5451d8e --- /dev/null +++ b/.docker/docker-entrypoint.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env sh + +echo +echo +echo "Please open your browser: 127.0.0.1:4000" +echo +echo + +exec nginx -g "daemon off;" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8b4db36..1f86ec3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -74,6 +74,8 @@ jobs: echo "FROM nginx:alpine" >> Dockerfile echo "COPY .vuepress/dist /usr/share/nginx/html" >> Dockerfile + echo "COPY .docker/docker-entrypoint.sh /" >> Dockerfile + echo "CMD [\"sh\", \"/docker-entrypoint.sh\"]" >> Dockerfile echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin @@ -82,6 +84,7 @@ jobs: docker build -t dockerpracticesig/docker_practice:vuepress \ --label org.opencontainers.image.revision=$VCS_REF \ --label org.opencontainers.image.source="https://github.com/yeasy/docker_practice" \ + --label maintainer="https://github.com/docker-practice" \ . docker push dockerpracticesig/docker_practice:vuepress diff --git a/.travis.yml b/.travis.yml index a43b38b..419c1a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,8 @@ after_success: - echo "FROM nginx:alpine" >> Dockerfile - echo "COPY _book /usr/share/nginx/html" >> Dockerfile +- echo "COPY .docker/docker-entrypoint.sh /" >> Dockerfile +- echo "CMD [\"sh\", \"/docker-entrypoint.sh\"]" >> Dockerfile - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - export VCS_REF=`git rev-parse --short HEAD` @@ -29,6 +31,7 @@ after_success: -t dockerpracticesig/docker_practice:gitbook \ --label org.opencontainers.image.revision=$VCS_REF \ --label org.opencontainers.image.source="https://github.com/yeasy/docker_practice" \ + --label maintainer="https://github.com/docker-practice" \ . - docker run -dit --rm -p 4000:80 dockerpracticesig/docker_practice