aws/aws-codebuild-docker-images

git command is not installed in image aws/codebuild/amazonlinux2-x86_64-standard:corretto8-23.05.22

y-isono opened this issue · 1 comments

Issue description
git command is not installed in image aws/codebuild/amazonlinux2-x86_64-standard:corretto8-23.05.22

To Reproduce
Steps to reproduce the behavior:

In build using that image, git command is fail.

ex)

version: 0.2
phases:
  build:
    commands:
      - git --version

It seems that in this image, git is not installed.

https://github.com/aws/aws-codebuild-docker-images/blob/master/al2/x86_64/standard/corretto8/Dockerfile#L14-L24

# Install git, SSH, and other utilities
RUN set -ex \
    && yum update -y \
    && yum install -y -q openssh-clients tar gzip wget unzip perl\
    && mkdir ~/.ssh \
    && mkdir -p /opt/tools \
    && mkdir -p /codebuild/image/config \
    && touch ~/.ssh/known_hosts \
    && ssh-keyscan -t rsa,dsa,ed25519,ecdsa -H github.com >> ~/.ssh/known_hosts \
    && ssh-keyscan -t rsa,dsa,ed25519,ecdsa -H bitbucket.org >> ~/.ssh/known_hosts \
    && chmod 600 ~/.ssh/known_hosts

Expected behavior
git command can be used in this image.

Workaround
Install git manually in buildspec.yaml
ex)

version: 0.2

phases:
  build:
    commands:
      - sudo yum install git -y
      - git --version