aws / aws-codebuild-docker-images

Official AWS CodeBuild repository for managed Docker images http://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref.html
Other
1.11k stars 973 forks source link

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

Closed y-isono closed 1 year ago

y-isono commented 1 year ago

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
leoherran-aws commented 1 year ago

Fixed in latest release https://github.com/aws/aws-codebuild-docker-images/commit/3228c52ba08b814ed435c4f4a514513b72b0d03b#diff-3962250b5d64adba08e1d4ce0d881297fd5a463568e349290414c5fcebefdc8c