This commit is contained in:
parent
f24c5f304f
commit
15a03887ce
@ -18,16 +18,16 @@ env:
|
||||
jobs:
|
||||
build:
|
||||
name: Build and push docker image
|
||||
runs-on: sysbox
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- name: install sysbox dependency
|
||||
run: |
|
||||
apt update
|
||||
apt upgrade -y
|
||||
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
|
||||
apt install nodejs -y
|
||||
node --version
|
||||
# - name: install sysbox dependency
|
||||
# run: |
|
||||
# apt update
|
||||
# apt upgrade -y
|
||||
# curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
|
||||
# apt install nodejs -y
|
||||
# node --version
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
@ -46,25 +46,28 @@ jobs:
|
||||
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: |
|
||||
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: apt update && apt install podman -y
|
||||
apt update
|
||||
apt install podman -y
|
||||
apt install buildah
|
||||
|
||||
# - name: 创建非特权用户
|
||||
# run: |
|
||||
@ -78,12 +81,12 @@ jobs:
|
||||
# # 4. 切换到非 root 用户
|
||||
# su - podmanuser
|
||||
|
||||
# - uses: redhat-actions/buildah-build@v2
|
||||
# with:
|
||||
# image: my-new-image
|
||||
# tags: v1 ${{ gitea.sha }}
|
||||
# dockerfiles: |
|
||||
# ./Dockerfile
|
||||
- uses: redhat-actions/buildah-build@v2
|
||||
with:
|
||||
image: my-new-image
|
||||
tags: v1 ${{ gitea.sha }}
|
||||
dockerfiles: |
|
||||
./Dockerfile
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user