Skip to content

Commit e153520

Browse files
authored
Install git into identity keyring test container image (Azure#26722)
* Install git into identity keyring test container image * Reference globals in identity dockerfile to skip security analysis * Bump dotnet patch versions and checksums * Install latest git into ubuntu keyring container * Bump identity ubuntu keyring testing image * Skip dotnet logger install in container jobs (don't require msbuild)
1 parent aae96eb commit e153520

File tree

5 files changed

+37
-19
lines changed

5 files changed

+37
-19
lines changed

eng/containers/UbuntuNetCoreKeyring/Dockerfile

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/powershell:7.1.4-ubuntu-focal AS build
1+
FROM mcr.microsoft.com/powershell:7.2.1-ubuntu-focal AS build
22

33
ENV \
44
NO_AT_BRIDGE=1 \
@@ -8,8 +8,8 @@ ENV \
88
# Do not generate certificate
99
DOTNET_GENERATE_ASPNET_CERTIFICATE=false \
1010
# SDK version
11-
DOTNET_SDK_VERSION_5.0=5.0.401 \
12-
DOTNET_SDK_VERSION_3_1=3.1.413 \
11+
DOTNET_SDK_VERSION_5_0=5.0.404 \
12+
DOTNET_SDK_VERSION_3_1=3.1.416 \
1313
# Enable correct mode for dotnet watch (only mode supported in a container)
1414
DOTNET_USE_POLLING_FILE_WATCHER=true \
1515
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
@@ -20,31 +20,39 @@ ENV \
2020
DOTNET_ROOT=/usr/share/dotnet \
2121
PATH=$PATH:usr/share/dotnet
2222

23-
# Install GNOME keyring
24-
RUN apt-get update \
23+
# Install apt-add-repository
24+
RUN apt-get update && apt-get install -y software-properties-common
25+
26+
# Install GNOME keyring, git >= 2.35 (for 'git sparse-checkout add' command)
27+
RUN apt-add-repository ppa:git-core/ppa \
28+
&& apt-get update \
2529
&& apt-get install -y \
2630
libsecret-1-dev \
2731
dbus-x11 \
2832
gnome-keyring \
2933
python \
30-
curl
34+
curl \
35+
git
3136

32-
# Below taken from https://hub.docker.com/_/microsoft-dotnet-sdk
33-
# https://github.com/dotnet/dotnet-docker/blob/ca43690e6e4ac9c21a990a012dc2eb07e78daf08/src/sdk/5.0/focal/amd64/Dockerfile
3437

3538
# Install .NET SDK
36-
RUN curl -SL --output dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Sdk/$DOTNET_SDK_VERSION_5.0/dotnet-sdk-$DOTNET_SDK_VERSION_5.0-linux-x64.tar.gz \
37-
&& dotnet_sha512='a444d44007709ceb68d8f72dec0531e17f85f800efc0007ace4fa66ba27f095066930e6c6defcd2f85cdedea2fec25e163f5da461c1c2b8563e5cd7cb47091e0' \
39+
40+
# Below adapated from https://hub.docker.com/_/microsoft-dotnet-sdk
41+
# https://github.com/dotnet/dotnet-docker/blob/b20c03e0644b42167d66a85fe6077ec2428a47fa/src/sdk/5.0/focal/amd64/Dockerfile
42+
RUN curl -fSL --output dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Sdk/$DOTNET_SDK_VERSION_5_0/dotnet-sdk-$DOTNET_SDK_VERSION_5_0-linux-x64.tar.gz \
43+
&& dotnet_sha512='6f9b83b2b661ce3b033a04d4c50ff3a435efa288de1a48f58be1150e64c5dd9d6bd2a4bf40f697dcd7d64ffaac24f14cc4a874e738544c5d0e8113c474fd2ee0' \
3844
&& echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \
3945
&& mkdir -p /usr/share/dotnet \
40-
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
46+
&& tar -ozxf dotnet.tar.gz -C /usr/share/dotnet \
4147
&& rm dotnet.tar.gz \
4248
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \
4349
# Trigger first run experience by running arbitrary cmd
4450
&& dotnet help
4551

46-
RUN curl -SL --output dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Sdk/$DOTNET_SDK_VERSION_3_1/dotnet-sdk-$DOTNET_SDK_VERSION_3_1-linux-x64.tar.gz \
47-
&& dotnet_sha512='2a0824f11aba0b79d3f9a36af0395649bc9b4137e61b240a48dccb671df0a5b8c2086054f8e495430b7ed6c344bb3f27ac3dfda5967d863718a6dadeca951a83' \
52+
# Below adapted from https://hub.docker.com/_/microsoft-dotnet-sdk
53+
# https://github.com/dotnet/dotnet-docker/blob/b20c03e0644b42167d66a85fe6077ec2428a47fa/src/sdk/3.1/focal/amd64/Dockerfile
54+
RUN curl -fSL --output dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Sdk/$DOTNET_SDK_VERSION_3_1/dotnet-sdk-$DOTNET_SDK_VERSION_3_1-linux-x64.tar.gz \
55+
&& dotnet_sha512='dec1dcf326487031c45dec0849a046a0d034d6cbb43ab591da6d94c2faf72da8e31deeaf4d2165049181546d5296bb874a039ccc2f618cf95e68a26399da5e7f' \
4856
&& echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \
4957
&& tar -ozxf dotnet.tar.gz -C /usr/share/dotnet \
5058
&& rm dotnet.tar.gz \

eng/containers/ci.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,15 @@ pool:
1212
vmImage: 'ubuntu-20.04'
1313

1414
variables:
15-
dockerfile: ./eng/containers/UbuntuNetCoreKeyring/Dockerfile
16-
containerRegistry: 'azsdkengsys'
17-
imageRepository: 'dotnet/ubuntu_netcore_keyring'
18-
imageTag: $(build.buildid)
15+
- template: /eng/pipelines/templates/variables/globals.yml
16+
- name: dockerfile
17+
value: ./eng/containers/UbuntuNetCoreKeyring/Dockerfile
18+
- name: containerRegistry
19+
value: 'azsdkengsys'
20+
- name: imageRepository
21+
value: 'dotnet/ubuntu_netcore_keyring'
22+
- name: imageTag
23+
value: $(build.buildid)
1924

2025
steps:
2126
- task: Docker@2
@@ -31,4 +36,4 @@ steps:
3136
containerRegistry: $(containerRegistry)
3237
repository: $(imageRepository)
3338
command: push
34-
tags: $(imageTag)
39+
tags: $(imageTag)

eng/pipelines/templates/jobs/live.tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ jobs:
114114
}
115115
displayName: Set Test Mode
116116
- template: /eng/pipelines/templates/steps/install-dotnet.yml
117+
parameters:
118+
Container: ${{ parameters.UsePlatformContainer }}
117119
- pwsh: >
118120
dotnet test eng/service.proj
119121
--framework $(TestTargetFramework)

eng/pipelines/templates/steps/install-dotnet.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
parameters:
22
EnableNuGetCache: true
33
NuGetCacheKey: 'Build'
4+
Container: false
45

56
steps:
67
- task: MSBuild@1
78
displayName: Install DevOps Logger
9+
condition: eq(${{ parameters.Container }}, false)
810
inputs:
911
solution: eng/InstallDevopsLogger.proj
1012
msbuildArguments: /p:WorkFolder="$(Agent.WorkFolder)" /p:BuildDirectory="$(Agent.BuildDirectory)"

sdk/identity/tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ trigger: none
33
resources:
44
containers:
55
- container: 'ubuntu_netcore_keyring'
6-
image: 'azsdkengsys.azurecr.io/dotnet/ubuntu_netcore50401_keyring:powershell714focalnet50401.4'
6+
# See ./eng/containers/UbuntuNetCoreKeyring/Dockerfile for tool versions
7+
image: 'azsdkengsys.azurecr.io/dotnet/ubuntu_netcore_keyring:1347171'
78
endpoint: 'azsdkengsys'
89
options: -ti --cap-add=IPC_LOCK
910

0 commit comments

Comments
 (0)