Docker, Unable to install GIT in Container

32 views Asked by At

I Created a container and tried to install GIT in the container through Dockerfile.

Appreciate your comments.

Tried to install GIT with Dockerfile, Error

=> [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => CACHED [1/2] FROM docker.io/library/ubuntu:latest 0.0s => ERROR [2/2] RUN yum install git -y 0.5s

[2/2] RUN yum install git -y: 0.294 /bin/sh: 1: yum: not found


Dockerfile:2

1 | FROM ubuntu 2 | >>> RUN yum install git -y

1

There are 1 answers

0
Dusan Manojlovic On

Have you tried using something like this in your Dockerfile:

RUN apt-get update && apt-get install -y git

If you want to use 'yum' you should use centos or radhat base image.