Skip to content

Commit 2316bd6

Browse files
committed
ci(docker): fix powershell correct arch
1 parent 61409e2 commit 2316bd6

File tree

3 files changed

+57
-4
lines changed

3 files changed

+57
-4
lines changed

.github/workflows/release.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ jobs:
7575
username: ${{ secrets.DOCKER_USER }}
7676
password: ${{ secrets.DOCKER_PASS }}
7777

78+
79+
7880
- name: Server meta
7981
id: server
8082
uses: docker/metadata-action@v5
@@ -129,6 +131,8 @@ jobs:
129131
labels: ${{ steps.server.outputs.labels }}
130132
tags: semaphoreui/semaphore:${{ github.ref_name }}-powershell7.5.0
131133

134+
135+
132136
- name: Runner meta
133137
id: runner
134138
uses: docker/metadata-action@v5
@@ -165,3 +169,18 @@ jobs:
165169
push: ${{ github.event_name != 'pull_request' }}
166170
labels: ${{ steps.runner.outputs.labels }}
167171
tags: semaphoreui/runner:${{ github.ref_name }}-ansible2.16.5
172+
173+
- name: Runner build with PowerShell 7.5.0
174+
uses: docker/build-push-action@v5
175+
with:
176+
builder: ${{ steps.buildx.outputs.name }}
177+
context: .
178+
build-args: |
179+
POWERSHELL_VERSION=7.5.0
180+
SEMAPHORE_IMAGE=semaphoreui/runner
181+
SEMAPHORE_VERSION=${{ github.ref_name }}
182+
file: deployment/docker/server/powershell/Dockerfile
183+
platforms: linux/amd64,linux/arm64 #,linux/arm/v6
184+
push: ${{ github.event_name != 'pull_request' }}
185+
labels: ${{ steps.runner.outputs.labels }}
186+
tags: semaphoreui/runner:${{ github.ref_name }}-powershell7.5.0
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
ARG SEMAPHORE_IMAGE
2+
ARG SEMAPHORE_VERSION
3+
4+
FROM ${SEMAPHORE_IMAGE}:${SEMAPHORE_VERSION}
5+
6+
ARG TARGETARCH
7+
ARG POWERSHELL_VERSION="7.5.0"
8+
9+
USER root
10+
11+
# Install dependencies
12+
RUN apk add --no-cache \
13+
curl \
14+
ca-certificates \
15+
less \
16+
ncurses \
17+
krb5-libs \
18+
libgcc \
19+
libintl \
20+
libssl3 \
21+
libstdc++ \
22+
tzdata \
23+
userspace-rcu \
24+
zlib
25+
26+
RUN wget -O /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v${POWERSHELL_VERSION}/powershell-${POWERSHELL_VERSION}-linux-${TARGETARCH/amd/x}.tar.gz
27+
28+
RUN mkdir -p /opt/microsoft/powershell/${POWERSHELL_VERSION} \
29+
&& tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/${POWERSHELL_VERSION} \
30+
&& rm /tmp/powershell.tar.gz \
31+
&& ln -s /opt/microsoft/powershell/${POWERSHELL_VERSION}/pwsh /usr/bin/pwsh
32+
33+
USER 1001

deployment/docker/server/powershell/Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
ARG SEMAPHORE_IMAGE="semaphoreui/semaphore"
2-
ARG SEMAPHORE_VERSION="latest"
1+
ARG SEMAPHORE_IMAGE
2+
ARG SEMAPHORE_VERSION
33

44
FROM ${SEMAPHORE_IMAGE}:${SEMAPHORE_VERSION}
55

6-
ARG TARGETARCH="amd64"
6+
ARG TARGETARCH
77
ARG POWERSHELL_VERSION="7.5.0"
88

99
USER root
@@ -28,6 +28,7 @@ RUN wget -O /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/rele
2828
RUN mkdir -p /opt/microsoft/powershell/${POWERSHELL_VERSION} \
2929
&& tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/${POWERSHELL_VERSION} \
3030
&& rm /tmp/powershell.tar.gz \
31-
&& ln -s /opt/microsoft/powershell/${POWERSHELL_VERSION}/pwsh /usr/bin/pwsh
31+
&& ln -s /opt/microsoft/powershell/${POWERSHELL_VERSION}/pwsh /usr/local/bin/pwsh \
32+
&& ln -s /opt/microsoft/powershell/${POWERSHELL_VERSION}/pwsh /usr/local/bin/powershell
3233

3334
USER 1001

0 commit comments

Comments
 (0)