Docker Community Forums

Share and learn in the Docker community.

How to install a local rpm file when building docker image?


(Urello) #1

Docker cannot locate my rpm. Pls help.

[root@lab7-dl580-2 mongodocker]# cat Dockerfile
FROM centos:latest
MAINTAINER test@test.io
ADD /home/mongod/mongodbJ-2.6.9-SOE.x86_64.rpm /mongodbJ-2.6.9-SOE.x86_64.rpm
RUN rpm -i /mongodbJ-2.6.9-SOE.x86_64.rpm; mkdir /mongodata
VOLUME /mongodata
EXPOSE 27017
ENTRYPOINT ["/usr/bin/mongod"]

[root@lab7-dl580-2 mongodocker]# ls /home/mongod/mongodbJ-2.6.9-SOE.x86_64.rpm
/home/mongod/mongodbJ-2.6.9-SOE.x86_64.rpm

[root@lab7-dl580-2 mongodocker]# docker build --rm -t mongod .
Sending build context to Docker daemon 2.048 kB
Step 0 : FROM centos:latest
 ---> 012c542f0150
Step 1 : MAINTAINER test@test.io
 ---> Using cache
 ---> 07a05b28e782
Step 2 : ADD /home/mongod/mongodbJ-2.6.9-SOE.x86_64.rpm /mongodbJ-2.6.9-SOE.x86_64.rpm
home/mongod/mongodbJ-2.6.9-SOE.x86_64.rpm: no such file or directory