This commit is contained in:
parent
f24c5f304f
commit
15a03887ce
@ -18,16 +18,16 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build and push docker image
|
name: Build and push docker image
|
||||||
runs-on: sysbox
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: install sysbox dependency
|
# - name: install sysbox dependency
|
||||||
run: |
|
# run: |
|
||||||
apt update
|
# apt update
|
||||||
apt upgrade -y
|
# apt upgrade -y
|
||||||
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
|
# curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
|
||||||
apt install nodejs -y
|
# apt install nodejs -y
|
||||||
node --version
|
# node --version
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@ -46,25 +46,28 @@ jobs:
|
|||||||
run: echo ${{ REGISTRY_PASSWORD }}
|
run: echo ${{ REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
|
||||||
- name: Build and Push Docker image
|
# - name: Build and Push Docker image
|
||||||
|
# run: |
|
||||||
|
# docker run \
|
||||||
|
# -v $(pwd):/workspace \
|
||||||
|
# -v /kaniko/.docker:/kaniko/.docker \
|
||||||
|
# -e DOCKER_CONFIG=/kaniko/.docker \
|
||||||
|
# gcr.io/kaniko-project/executor:latest \
|
||||||
|
# --context=dir:///workspace \
|
||||||
|
# --dockerfile=/workspace/Dockerfile \
|
||||||
|
# --destination=${{ IMAGE_REGISTRY }}/test-devops:0.0.1
|
||||||
|
# env:
|
||||||
|
# DOCKER_CONFIG: /kaniko/.docker
|
||||||
|
# IMAGE_REGISTRY: ${{ IMAGE_REGISTRY }}
|
||||||
|
# REGISTRY_USERNAME: ${{ REGISTRY_USERNAME }}
|
||||||
|
# REGISTRY_PASSWORD: ${{ REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
|
||||||
|
- name: install podman
|
||||||
run: |
|
run: |
|
||||||
docker run \
|
apt update
|
||||||
-v $(pwd):/workspace \
|
apt install podman -y
|
||||||
-v /kaniko/.docker:/kaniko/.docker \
|
apt install buildah
|
||||||
-e DOCKER_CONFIG=/kaniko/.docker \
|
|
||||||
gcr.io/kaniko-project/executor:latest \
|
|
||||||
--context=dir:///workspace \
|
|
||||||
--dockerfile=/workspace/Dockerfile \
|
|
||||||
--destination=${{ IMAGE_REGISTRY }}/test-devops:0.0.1
|
|
||||||
env:
|
|
||||||
DOCKER_CONFIG: /kaniko/.docker
|
|
||||||
IMAGE_REGISTRY: ${{ IMAGE_REGISTRY }}
|
|
||||||
REGISTRY_USERNAME: ${{ REGISTRY_USERNAME }}
|
|
||||||
REGISTRY_PASSWORD: ${{ REGISTRY_PASSWORD }}
|
|
||||||
|
|
||||||
|
|
||||||
# - name: install podman
|
|
||||||
# run: apt update && apt install podman -y
|
|
||||||
|
|
||||||
# - name: 创建非特权用户
|
# - name: 创建非特权用户
|
||||||
# run: |
|
# run: |
|
||||||
@ -78,12 +81,12 @@ jobs:
|
|||||||
# # 4. 切换到非 root 用户
|
# # 4. 切换到非 root 用户
|
||||||
# su - podmanuser
|
# su - podmanuser
|
||||||
|
|
||||||
# - uses: redhat-actions/buildah-build@v2
|
- uses: redhat-actions/buildah-build@v2
|
||||||
# with:
|
with:
|
||||||
# image: my-new-image
|
image: my-new-image
|
||||||
# tags: v1 ${{ gitea.sha }}
|
tags: v1 ${{ gitea.sha }}
|
||||||
# dockerfiles: |
|
dockerfiles: |
|
||||||
# ./Dockerfile
|
./Dockerfile
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user