Skip to content

Commit

Permalink
Merge pull request #44 from theohbrothers/enhancement/add-git-variants
Browse files Browse the repository at this point in the history
Enhancement: Add `git` variants
  • Loading branch information
leojonathanoh authored Sep 20, 2023
2 parents cfcffe6 + d8658b2 commit 811d7ba
Show file tree
Hide file tree
Showing 29 changed files with 2,079 additions and 133 deletions.
1,806 changes: 1,683 additions & 123 deletions .github/workflows/ci-master-pr.yml

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,43 @@ Dockerized `powershell`, based on [mcr.microsoft.com/powershell](https://hub.doc
| Tag | Dockerfile Build Context |
|:-------:|:---------:|
| `:7.3-alpine-3.17` | [View](variants/7.3-alpine-3.17) |
| `:7.3-alpine-3.17-git` | [View](variants/7.3-alpine-3.17-git) |
| `:7.3-alpine-3.17-git-sops` | [View](variants/7.3-alpine-3.17-git-sops) |
| `:7.2-alpine-3.17` | [View](variants/7.2-alpine-3.17) |
| `:7.2-alpine-3.17-git` | [View](variants/7.2-alpine-3.17-git) |
| `:7.2-alpine-3.17-git-sops` | [View](variants/7.2-alpine-3.17-git-sops) |
| `:7.1.5-alpine-3.13` | [View](variants/7.1.5-alpine-3.13) |
| `:7.1.5-alpine-3.13-git` | [View](variants/7.1.5-alpine-3.13-git) |
| `:7.1.5-alpine-3.13-git-sops` | [View](variants/7.1.5-alpine-3.13-git-sops) |
| `:7.0.3-alpine-3.9` | [View](variants/7.0.3-alpine-3.9) |
| `:7.0.3-alpine-3.9-git` | [View](variants/7.0.3-alpine-3.9-git) |
| `:7.0.3-alpine-3.9-git-sops` | [View](variants/7.0.3-alpine-3.9-git-sops) |
| `:6.2.4-alpine-3.8` | [View](variants/6.2.4-alpine-3.8) |
| `:6.2.4-alpine-3.8-git` | [View](variants/6.2.4-alpine-3.8-git) |
| `:6.2.4-alpine-3.8-git-sops` | [View](variants/6.2.4-alpine-3.8-git-sops) |
| `:6.1.3-alpine-3.8` | [View](variants/6.1.3-alpine-3.8) |
| `:6.1.3-alpine-3.8-git` | [View](variants/6.1.3-alpine-3.8-git) |
| `:6.1.3-alpine-3.8-git-sops` | [View](variants/6.1.3-alpine-3.8-git-sops) |
| `:7.3-ubuntu-22.04`, `:latest` | [View](variants/7.3-ubuntu-22.04) |
| `:7.3-ubuntu-22.04-git` | [View](variants/7.3-ubuntu-22.04-git) |
| `:7.3-ubuntu-22.04-git-sops` | [View](variants/7.3-ubuntu-22.04-git-sops) |
| `:7.2-ubuntu-22.04` | [View](variants/7.2-ubuntu-22.04) |
| `:7.2-ubuntu-22.04-git` | [View](variants/7.2-ubuntu-22.04-git) |
| `:7.2-ubuntu-22.04-git-sops` | [View](variants/7.2-ubuntu-22.04-git-sops) |
| `:7.1.5-ubuntu-20.04` | [View](variants/7.1.5-ubuntu-20.04) |
| `:7.1.5-ubuntu-20.04-git` | [View](variants/7.1.5-ubuntu-20.04-git) |
| `:7.1.5-ubuntu-20.04-git-sops` | [View](variants/7.1.5-ubuntu-20.04-git-sops) |
| `:7.0.3-ubuntu-18.04` | [View](variants/7.0.3-ubuntu-18.04) |
| `:7.0.3-ubuntu-18.04-git` | [View](variants/7.0.3-ubuntu-18.04-git) |
| `:7.0.3-ubuntu-18.04-git-sops` | [View](variants/7.0.3-ubuntu-18.04-git-sops) |
| `:6.2.4-ubuntu-18.04` | [View](variants/6.2.4-ubuntu-18.04) |
| `:6.2.4-ubuntu-18.04-git` | [View](variants/6.2.4-ubuntu-18.04-git) |
| `:6.2.4-ubuntu-18.04-git-sops` | [View](variants/6.2.4-ubuntu-18.04-git-sops) |
| `:6.1.3-ubuntu-18.04` | [View](variants/6.1.3-ubuntu-18.04) |
| `:6.1.3-ubuntu-18.04-git` | [View](variants/6.1.3-ubuntu-18.04-git) |
| `:6.1.3-ubuntu-18.04-git-sops` | [View](variants/6.1.3-ubuntu-18.04-git-sops) |
| `:6.0.4-ubuntu-16.04` | [View](variants/6.0.4-ubuntu-16.04) |
| `:6.0.4-ubuntu-16.04-git` | [View](variants/6.0.4-ubuntu-16.04-git) |
| `:6.0.4-ubuntu-16.04-git-sops` | [View](variants/6.0.4-ubuntu-16.04-git-sops) |

## Development
Expand Down
1 change: 1 addition & 0 deletions generate/definitions/VARIANTS.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ $local:VARIANTS_MATRIX = @(
base_image_tag = $_
subvariants = @(
@{ components = @() }
@{ components = @( 'git' ) }
@{ components = @( 'git', 'sops' ) }
)
}
Expand Down
24 changes: 24 additions & 0 deletions variants/6.0.4-ubuntu-16.04-git/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM mcr.microsoft.com/powershell:6.0.4-ubuntu-16.04

# Disable telemetry for powershell 7.0.0 and above and .NET core: https://github.com/PowerShell/PowerShell/issues/16234#issuecomment-942139350
ENV POWERSHELL_CLI_TELEMETRY_OPTOUT=1
ENV POWERSHELL_TELEMETRY_OPTOUT=1
ENV POWERSHELL_UPDATECHECK=Off
ENV POWERSHELL_UPDATECHECK_OPTOUT=1
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
ENV DOTNET_TELEMETRY_OPTOUT=1
ENV COMPlus_EnableDiagnostics=0

# Install Pester
RUN pwsh -c 'Install-Module Pester -Scope AllUsers -MinimumVersion 4.0.0 -MaximumVersion 4.10.1 -Force -ErrorAction Stop -Verbose'
RUN pwsh -c 'Install-Module Pester -Scope AllUsers -MinimumVersion 5.0.0 -Force -ErrorAction Stop -Verbose'

RUN set -eux; \
apt-get update; \
apt-get install -y git; \
rm -rf /var/lib/apt/lists/*

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

ENTRYPOINT [ "/docker-entrypoint.sh" ]
8 changes: 8 additions & 0 deletions variants/6.0.4-ubuntu-16.04-git/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- pwsh "$@"
fi

exec "$@"
17 changes: 17 additions & 0 deletions variants/6.1.3-alpine-3.8-git/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
FROM mcr.microsoft.com/powershell:6.1.3-alpine-3.8

# Disable telemetry for powershell 7.0.0 and above and .NET core: https://github.com/PowerShell/PowerShell/issues/16234#issuecomment-942139350
ENV POWERSHELL_CLI_TELEMETRY_OPTOUT=1
ENV POWERSHELL_TELEMETRY_OPTOUT=1
ENV POWERSHELL_UPDATECHECK=Off
ENV POWERSHELL_UPDATECHECK_OPTOUT=1
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
ENV DOTNET_TELEMETRY_OPTOUT=1
ENV COMPlus_EnableDiagnostics=0

# Install Pester
RUN pwsh -c 'Install-Module Pester -Scope AllUsers -MinimumVersion 4.0.0 -MaximumVersion 4.10.1 -Force -ErrorAction Stop -Verbose'
RUN pwsh -c 'Install-Module Pester -Scope AllUsers -MinimumVersion 5.0.0 -Force -ErrorAction Stop -Verbose'

RUN apk add --no-cache git

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

ENTRYPOINT [ "/docker-entrypoint.sh" ]
8 changes: 8 additions & 0 deletions variants/6.1.3-alpine-3.8-git/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- pwsh "$@"
fi

exec "$@"
24 changes: 21 additions & 3 deletions variants/6.1.3-ubuntu-18.04-git/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
FROM mcr.microsoft.com/powershell:6.1.3-ubuntu-18.04

RUN apt-get update \
&& apt-get install -y git \
&& rm -rf /var/lib/apt/lists/*
# Disable telemetry for powershell 7.0.0 and above and .NET core: https://github.com/PowerShell/PowerShell/issues/16234#issuecomment-942139350
ENV POWERSHELL_CLI_TELEMETRY_OPTOUT=1
ENV POWERSHELL_TELEMETRY_OPTOUT=1
ENV POWERSHELL_UPDATECHECK=Off
ENV POWERSHELL_UPDATECHECK_OPTOUT=1
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
ENV DOTNET_TELEMETRY_OPTOUT=1
ENV COMPlus_EnableDiagnostics=0

# Install Pester
RUN pwsh -c 'Install-Module Pester -Scope AllUsers -MinimumVersion 4.0.0 -MaximumVersion 4.10.1 -Force -ErrorAction Stop -Verbose'
RUN pwsh -c 'Install-Module Pester -Scope AllUsers -MinimumVersion 5.0.0 -Force -ErrorAction Stop -Verbose'

RUN set -eux; \
apt-get update; \
apt-get install -y git; \
rm -rf /var/lib/apt/lists/*

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

ENTRYPOINT [ "/docker-entrypoint.sh" ]
8 changes: 8 additions & 0 deletions variants/6.1.3-ubuntu-18.04-git/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- pwsh "$@"
fi

exec "$@"
17 changes: 17 additions & 0 deletions variants/6.2.4-alpine-3.8-git/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
FROM mcr.microsoft.com/powershell:6.2.4-alpine-3.8

# Disable telemetry for powershell 7.0.0 and above and .NET core: https://github.com/PowerShell/PowerShell/issues/16234#issuecomment-942139350
ENV POWERSHELL_CLI_TELEMETRY_OPTOUT=1
ENV POWERSHELL_TELEMETRY_OPTOUT=1
ENV POWERSHELL_UPDATECHECK=Off
ENV POWERSHELL_UPDATECHECK_OPTOUT=1
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
ENV DOTNET_TELEMETRY_OPTOUT=1
ENV COMPlus_EnableDiagnostics=0

# Install Pester
RUN pwsh -c 'Install-Module Pester -Scope AllUsers -MinimumVersion 4.0.0 -MaximumVersion 4.10.1 -Force -ErrorAction Stop -Verbose'
RUN pwsh -c 'Install-Module Pester -Scope AllUsers -MinimumVersion 5.0.0 -Force -ErrorAction Stop -Verbose'

RUN apk add --no-cache git

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

ENTRYPOINT [ "/docker-entrypoint.sh" ]
8 changes: 8 additions & 0 deletions variants/6.2.4-alpine-3.8-git/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- pwsh "$@"
fi

exec "$@"
24 changes: 21 additions & 3 deletions variants/6.2.4-ubuntu-18.04-git/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
FROM mcr.microsoft.com/powershell:6.2.4-ubuntu-18.04

RUN apt-get update \
&& apt-get install -y git \
&& rm -rf /var/lib/apt/lists/*
# Disable telemetry for powershell 7.0.0 and above and .NET core: https://github.com/PowerShell/PowerShell/issues/16234#issuecomment-942139350
ENV POWERSHELL_CLI_TELEMETRY_OPTOUT=1
ENV POWERSHELL_TELEMETRY_OPTOUT=1
ENV POWERSHELL_UPDATECHECK=Off
ENV POWERSHELL_UPDATECHECK_OPTOUT=1
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
ENV DOTNET_TELEMETRY_OPTOUT=1
ENV COMPlus_EnableDiagnostics=0

# Install Pester
RUN pwsh -c 'Install-Module Pester -Scope AllUsers -MinimumVersion 4.0.0 -MaximumVersion 4.10.1 -Force -ErrorAction Stop -Verbose'
RUN pwsh -c 'Install-Module Pester -Scope AllUsers -MinimumVersion 5.0.0 -Force -ErrorAction Stop -Verbose'

RUN set -eux; \
apt-get update; \
apt-get install -y git; \
rm -rf /var/lib/apt/lists/*

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

ENTRYPOINT [ "/docker-entrypoint.sh" ]
8 changes: 8 additions & 0 deletions variants/6.2.4-ubuntu-18.04-git/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- pwsh "$@"
fi

exec "$@"
21 changes: 21 additions & 0 deletions variants/7.0.3-alpine-3.9-git/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM mcr.microsoft.com/powershell:7.0.3-alpine-3.9-20200928

# Disable telemetry for powershell 7.0.0 and above and .NET core: https://github.com/PowerShell/PowerShell/issues/16234#issuecomment-942139350
ENV POWERSHELL_CLI_TELEMETRY_OPTOUT=1
ENV POWERSHELL_TELEMETRY_OPTOUT=1
ENV POWERSHELL_UPDATECHECK=Off
ENV POWERSHELL_UPDATECHECK_OPTOUT=1
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
ENV DOTNET_TELEMETRY_OPTOUT=1
ENV COMPlus_EnableDiagnostics=0

# Install Pester
RUN pwsh -c 'Install-Module Pester -Scope AllUsers -MinimumVersion 4.0.0 -MaximumVersion 4.10.1 -Force -ErrorAction Stop -Verbose'
RUN pwsh -c 'Install-Module Pester -Scope AllUsers -MinimumVersion 5.0.0 -Force -ErrorAction Stop -Verbose'

RUN apk add --no-cache git

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

ENTRYPOINT [ "/docker-entrypoint.sh" ]
8 changes: 8 additions & 0 deletions variants/7.0.3-alpine-3.9-git/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- pwsh "$@"
fi

exec "$@"
26 changes: 22 additions & 4 deletions variants/7.0.3-ubuntu-18.04-git/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
FROM mcr.microsoft.com/powershell:7.0.3-ubuntu-18.04
FROM mcr.microsoft.com/powershell:7.0.3-ubuntu-18.04-20201027

RUN apt-get update \
&& apt-get install -y git \
&& rm -rf /var/lib/apt/lists/*
# Disable telemetry for powershell 7.0.0 and above and .NET core: https://github.com/PowerShell/PowerShell/issues/16234#issuecomment-942139350
ENV POWERSHELL_CLI_TELEMETRY_OPTOUT=1
ENV POWERSHELL_TELEMETRY_OPTOUT=1
ENV POWERSHELL_UPDATECHECK=Off
ENV POWERSHELL_UPDATECHECK_OPTOUT=1
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
ENV DOTNET_TELEMETRY_OPTOUT=1
ENV COMPlus_EnableDiagnostics=0

# Install Pester
RUN pwsh -c 'Install-Module Pester -Scope AllUsers -MinimumVersion 4.0.0 -MaximumVersion 4.10.1 -Force -ErrorAction Stop -Verbose'
RUN pwsh -c 'Install-Module Pester -Scope AllUsers -MinimumVersion 5.0.0 -Force -ErrorAction Stop -Verbose'

RUN set -eux; \
apt-get update; \
apt-get install -y git; \
rm -rf /var/lib/apt/lists/*

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

ENTRYPOINT [ "/docker-entrypoint.sh" ]
8 changes: 8 additions & 0 deletions variants/7.0.3-ubuntu-18.04-git/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- pwsh "$@"
fi

exec "$@"
21 changes: 21 additions & 0 deletions variants/7.1.5-alpine-3.13-git/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM mcr.microsoft.com/powershell:7.1.5-alpine-3.13-20211021

# Disable telemetry for powershell 7.0.0 and above and .NET core: https://github.com/PowerShell/PowerShell/issues/16234#issuecomment-942139350
ENV POWERSHELL_CLI_TELEMETRY_OPTOUT=1
ENV POWERSHELL_TELEMETRY_OPTOUT=1
ENV POWERSHELL_UPDATECHECK=Off
ENV POWERSHELL_UPDATECHECK_OPTOUT=1
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
ENV DOTNET_TELEMETRY_OPTOUT=1
ENV COMPlus_EnableDiagnostics=0

# Install Pester
RUN pwsh -c 'Install-Module Pester -Scope AllUsers -MinimumVersion 4.0.0 -MaximumVersion 4.10.1 -Force -ErrorAction Stop -Verbose'
RUN pwsh -c 'Install-Module Pester -Scope AllUsers -MinimumVersion 5.0.0 -Force -ErrorAction Stop -Verbose'

RUN apk add --no-cache git

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

ENTRYPOINT [ "/docker-entrypoint.sh" ]
8 changes: 8 additions & 0 deletions variants/7.1.5-alpine-3.13-git/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- pwsh "$@"
fi

exec "$@"
24 changes: 24 additions & 0 deletions variants/7.1.5-ubuntu-20.04-git/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM mcr.microsoft.com/powershell:7.1.5-ubuntu-20.04-20211021

# Disable telemetry for powershell 7.0.0 and above and .NET core: https://github.com/PowerShell/PowerShell/issues/16234#issuecomment-942139350
ENV POWERSHELL_CLI_TELEMETRY_OPTOUT=1
ENV POWERSHELL_TELEMETRY_OPTOUT=1
ENV POWERSHELL_UPDATECHECK=Off
ENV POWERSHELL_UPDATECHECK_OPTOUT=1
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
ENV DOTNET_TELEMETRY_OPTOUT=1
ENV COMPlus_EnableDiagnostics=0

# Install Pester
RUN pwsh -c 'Install-Module Pester -Scope AllUsers -MinimumVersion 4.0.0 -MaximumVersion 4.10.1 -Force -ErrorAction Stop -Verbose'
RUN pwsh -c 'Install-Module Pester -Scope AllUsers -MinimumVersion 5.0.0 -Force -ErrorAction Stop -Verbose'

RUN set -eux; \
apt-get update; \
apt-get install -y git; \
rm -rf /var/lib/apt/lists/*

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

ENTRYPOINT [ "/docker-entrypoint.sh" ]
8 changes: 8 additions & 0 deletions variants/7.1.5-ubuntu-20.04-git/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- pwsh "$@"
fi

exec "$@"
21 changes: 21 additions & 0 deletions variants/7.2-alpine-3.17-git/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM mcr.microsoft.com/powershell:lts-7.2-alpine-3.17

# Disable telemetry for powershell 7.0.0 and above and .NET core: https://github.com/PowerShell/PowerShell/issues/16234#issuecomment-942139350
ENV POWERSHELL_CLI_TELEMETRY_OPTOUT=1
ENV POWERSHELL_TELEMETRY_OPTOUT=1
ENV POWERSHELL_UPDATECHECK=Off
ENV POWERSHELL_UPDATECHECK_OPTOUT=1
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
ENV DOTNET_TELEMETRY_OPTOUT=1
ENV COMPlus_EnableDiagnostics=0

# Install Pester
RUN pwsh -c 'Install-Module Pester -Scope AllUsers -MinimumVersion 4.0.0 -MaximumVersion 4.10.1 -Force -ErrorAction Stop -Verbose'
RUN pwsh -c 'Install-Module Pester -Scope AllUsers -MinimumVersion 5.0.0 -Force -ErrorAction Stop -Verbose'

RUN apk add --no-cache git

COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x docker-entrypoint.sh

ENTRYPOINT [ "/docker-entrypoint.sh" ]
8 changes: 8 additions & 0 deletions variants/7.2-alpine-3.17-git/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then
set -- pwsh "$@"
fi

exec "$@"
Loading

0 comments on commit 811d7ba

Please sign in to comment.