This commit is contained in:
26
.gitea/workflows/release.yml
Normal file
26
.gitea/workflows/release.yml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Log in to GitHub Container Registry
|
||||||
|
uses: actions/docker-login@v2
|
||||||
|
with:
|
||||||
|
registry: git.coocn.cn
|
||||||
|
username: ${{ secrets.USERNAME }}
|
||||||
|
password: ${{ secrets.PASSWORD }}
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: actions/docker-build@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: git.coocn.cn/${{ github.repository }}
|
||||||
7
Dockerfile
Normal file
7
Dockerfile
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
FROM ubuntu:22.04
|
||||||
|
|
||||||
|
COPY nerdctl-2.1.3-linux-amd64.tar.gz /tmp/nerdctl.tgz
|
||||||
|
RUN tar -xzf /tmp/nerdctl.tgz -C /usr/local/bin && rm -rf /tmp/*
|
||||||
|
|
||||||
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
16
action.yml
Normal file
16
action.yml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
name: "Nerdctl Compose Action"
|
||||||
|
description: "在容器中使用 nerdctl 启动容器"
|
||||||
|
author: "coocn"
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
file:
|
||||||
|
description: "要启动的Compose配置文件路径"
|
||||||
|
required: true
|
||||||
|
args:
|
||||||
|
description: "传递给 nerdctl 的参数"
|
||||||
|
required: false
|
||||||
|
default: up -d
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "docker"
|
||||||
|
image: "docker://ghcr.io/${{ github.repository }}:latest"
|
||||||
5
entrypoint.sh
Executable file
5
entrypoint.sh
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "Running nerdctl compose with file: $INPUT_FILE"
|
||||||
|
exec nerdctl compose -f "$INPUT_FILE" $INPUT_ARGS
|
||||||
BIN
nerdctl-2.1.3-linux-amd64.tar.gz
Normal file
BIN
nerdctl-2.1.3-linux-amd64.tar.gz
Normal file
Binary file not shown.
Reference in New Issue
Block a user