Skip to content

Commit f910849

Browse files
authored
Refactor entrypoint script and install command
1 parent 87bf6dc commit f910849

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

docker/linux-arm32.dockerfile

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,29 @@ RUN set -eux; \
2222
ARG PNP_VERSION=3.1.306-nightly
2323
ENV PNP_VERSION=${PNP_VERSION} TZ=Etc/UTC
2424

25-
# ---- Write entrypoint script via heredoc (no semicolon/backslash after <<'SH') ----
25+
# ---- Write entrypoint script via heredoc ----
2626
RUN set -eux; \
2727
install -d -m 0755 /usr/local/bin; \
2828
cat > /usr/local/bin/docker-entrypoint.sh <<'SH'
2929
#!/bin/sh
3030
set -eu
3131

3232
# First-run install on real ARM32 (avoid QEMU build-time crashes)
33-
pwsh -NoLogo -NoProfile -Command "
34-
$m = Get-Module -ListAvailable PnP.PowerShell -ErrorAction SilentlyContinue;
35-
if (-not $m) {
36-
Install-Module PnP.PowerShell -Scope AllUsers -Force -AllowPrerelease -SkipPublisherCheck -RequiredVersion $env:PNP_VERSION;
37-
Write-Host 'PnP.PowerShell installed.';
38-
} else {
39-
Write-Host 'PnP.PowerShell already present.';
40-
}"
33+
pwsh -NoLogo -NoProfile -NonInteractive -Command '
34+
Install-Module PnP.PowerShell `
35+
-Scope AllUsers `
36+
-Force `
37+
-AllowPrerelease `
38+
-SkipPublisherCheck `
39+
-RequiredVersion $env:PNP_VERSION;
40+
Write-Host "PnP.PowerShell installed.";
41+
'
42+
4143
# Hand off to PowerShell; forward all container args
4244
exec pwsh -NoLogo "$@"
4345
SH
4446

45-
# mark executable in a separate RUN (simplest, avoids heredoc chaining quirks)
47+
# Mark executable
4648
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
4749

4850
# Use exec-form ENTRYPOINT so signals are delivered to pwsh

0 commit comments

Comments
 (0)