Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade #918

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/build-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: ci

on:
workflow_dispatch:
push:

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64
context: .
push: true
tags: zqjimlove/jenkins-agent:latest
25 changes: 0 additions & 25 deletions .github/workflows/release-drafter.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/update-dockerhub-description.yaml

This file was deleted.

47 changes: 47 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
FROM jenkins/inbound-agent:latest

# 切换到 root 用户
USER root

# 更新包列表并安装 sudo 和 rsync
RUN apt-get -yqq update \
&& apt-get --yes --no-install-recommends install \
ca-certificates \
curl \
fontconfig \
git \
git-lfs \
less \
netbase \
openssh-client \
patch \
tzdata \
rsync \
sudo \
python3 \
make \
&& apt-get clean \
&& rm -rf /tmp/* /var/cache/* /var/lib/apt/lists/*

# 添加 jenkins 用户到 sudoers 文件并允许无密码 sudo
RUN chmod +w /etc/sudoers && echo 'jenkins ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers && chmod -r /etc/sudoers

RUN sudo apt-get update
RUN sudo apt-get install ca-certificates curl
RUN sudo install -m 0755 -d /etc/apt/keyrings
RUN sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
RUN sudo chmod a+r /etc/apt/keyrings/docker.asc

RUN echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
RUN sudo apt-get update
RUN sudo apt-get --yes --no-install-recommends install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin


# 切换回 jenkins 用户
USER ${user}

RUN mkdir -p /home/${user}/.ssh
RUN mkdir -p /home/${user}/store
2 changes: 2 additions & 0 deletions debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ RUN apt-get update \
openssh-client \
patch \
tzdata \
rsync \
sudo \
&& apt-get clean \
&& rm -rf /tmp/* /var/cache/* /var/lib/apt/lists/*

Expand Down
Loading