Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install Redis on Alpine based image in docker

I am trying to install Redis on the golang:1.10.1-alpine3.7 image. I tried RUN apk add --no-cache redis, but when I tried to run the redis-cli command, I get an exit status 127, which means the given command in not found. I would like to know how I would be able to run the redis-cli command.

like image 854
mrdoubtful Avatar asked Apr 28 '18 05:04

mrdoubtful


People also ask

Can Docker run on Alpine?

To install Docker on Alpine Linux, run apk add --update docker openrc. The Docker package is available in the Community repository. Therefore, if apk add fails because of unsatisfiable constraints error, you need to edit the /etc/apk/repositories file to add (or uncomment) a line.

What is Alpine based Docker image?

Alpine Linux is a Linux distribution built around musl libc and BusyBox. The image is only 5 MB in size and has access to a package repository that is much more complete than other BusyBox based images. This makes Alpine Linux a great image base for utilities and even production applications.


1 Answers

Try using the fully qualified path of the command - /usr/bin/redis-cli.

like image 72
Yaron Idan Avatar answered Sep 30 '22 11:09

Yaron Idan