Skip to content

docker-构建和提交docker #84

docker-构建和提交docker

docker-构建和提交docker #84

Workflow file for this run

name: docker-构建和提交docker
on:
push:
paths:
- "docker/**"
- "common/open-sshd-passwd.sh"
- ".github/workflows/docker.yml"
- "!**.md"
schedule:
- cron: '0 2 2 * *' # Weekly on Sundays at 02:00
jobs:
setup-build-publish:
runs-on: ubuntu-latest
name: 构建和推送docker镜像
steps:
- name: Checkout
# 使用action库 actions/checkout获取源码
uses: actions/checkout@v2.3.2
# ########## v3版本 ###########################
-
name: 登录 Docker Hub
uses: docker/login-action@v2
with:
username: adockero
password: ${{ secrets.PASSWORD }}
# ############## dind-http-shell ########################
- name: docker:dind-http-shell
uses: docker/build-push-action@v3
with:
# Comma-delimited list of tags. These will be added to the registry/repository to form the image's tags
tags: adockero/docker:dind-http-shell
context: ./docker/http_shell/
file: ./docker/http_shell/Dockerfile
# Always attempt to pull a newer version of the image
pull: true
push: true
# 构建参数
# build-args: |
# APT_ARGS=docker.io
# Adds labels with git repository information to the built image
labels: true
# ############## ubuntu - end ########################
- name: docker-ubuntu
uses: docker/build-push-action@v3
with:
# Comma-delimited list of tags. These will be added to the registry/repository to form the image's tags
tags: adockero/docker:ubuntu,adockero/docker-ubuntu:latest
context: .
file: docker/Dockerfile.ubuntu
# Always attempt to pull a newer version of the image
pull: true
push: true
# 构建参数
build-args: |
APT_ARGS=docker.io
# Adds labels with git repository information to the built image
labels: true
- name: docker-ubuntu-ssh
uses: docker/build-push-action@v3
with:
# Comma-delimited list of tags. These will be added to the registry/repository to form the image's tags
tags: adockero/docker:ubuntu-ssh,adockero/docker-ubuntu:ssh
context: .
file: docker/Dockerfile.ubuntu
# Always attempt to pull a newer version of the image
pull: true
push: true
# 构建参数
build-args: |
APT_ARGS=docker.io ssh
# Adds labels with git repository information to the built image
labels: true
# ############## ubuntu - end ########################
- name: docker-dind-sshd-latest
uses: docker/build-push-action@v1.1.0
with:
# Username used to log in to a Docker registry. If not set then no login will occur
username: adockero
# Password or personal access token used to log in to a Docker registry. If not set then no login will occur
password: ${{ secrets.PASSWORD }}
# Docker repository to tag the image with
repository: adockero/docker
# Comma-delimited list of tags. These will be added to the registry/repository to form the image's tags
tags: dind-sshd
# Path to the Dockerfile (Default is '{path}/Dockerfile')
path: ./
dockerfile: docker/Dockerfile.sshd
# Always attempt to pull a newer version of the image
always_pull: true
# 构建参数
build_args: VERSION=dind
# Adds labels with git repository information to the built image
add_git_labels: true
- name: docker-sshd-latest
uses: docker/build-push-action@v1.1.0
with:
# Username used to log in to a Docker registry. If not set then no login will occur
username: adockero
# Password or personal access token used to log in to a Docker registry. If not set then no login will occur
password: ${{ secrets.PASSWORD }}
# Docker repository to tag the image with
repository: adockero/docker
# Comma-delimited list of tags. These will be added to the registry/repository to form the image's tags
tags: sshd
# Path to the Dockerfile (Default is '{path}/Dockerfile')
path: ./
dockerfile: docker/Dockerfile.sshd
# Always attempt to pull a newer version of the image
always_pull: true
# 构建参数
build_args: VERSION=latest
# Adds labels with git repository information to the built image
add_git_labels: true
# ############## dind-sshd-ubuntu ########################
- name: docker-dind-sshd-ubuntu-latest
uses: docker/build-push-action@v1.1.0
with:
# Username used to log in to a Docker registry. If not set then no login will occur
username: adockero
# Password or personal access token used to log in to a Docker registry. If not set then no login will occur
password: ${{ secrets.PASSWORD }}
# Docker repository to tag the image with
repository: adockero/docker
# Comma-delimited list of tags. These will be added to the registry/repository to form the image's tags
tags: dind-sshd-ubuntu
# Path to the Dockerfile (Default is '{path}/Dockerfile')
path: ./
dockerfile: docker/Dockerfile.dind.sshd
# Always attempt to pull a newer version of the image
always_pull: true
# 构建参数
# build_args: FROM_BASE=adockero/docker:dind-sshd
# Adds labels with git repository information to the built image
add_git_labels: true