Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dockerfile and dpkg command

I'm trying to create a Dockerfile to install VuFind.

This is my Dockerfile:

#Name of container: docker-vufind:3

# Pull base image
FROM ubuntu:16.04
MAINTAINER xxx  "[email protected]"

#Install latest patches
RUN apt-get update && apt-get install -y \
    && apt-get install -y wget 

#Obtain the package
RUN wget http://downloads.sourceforge.net/vufind/vufind_3.1.1.deb?use_mirror=osdn -O vufind_3.1.1.deb

#Install it
RUN dpkg -i vufind_3.1.1.deb

#Install VuFind's dependecies
RUN apt-get install -y -f

I launched these commands on my Ubuntu's bash and the software worked fine, but it seems that I can't obtain the same result with the Dockerfile because the dpkg command failed for the lack of the dependencies.

The command '/bin/sh -c dpkg -i vufind_3.1.1.deb' returned a non-zero code: 1

Is installing the dependecies (Apache, jdk, php...) before the dpkg command line the only way to create a working Dockerfile or is there a shorter way ?

like image 550
Pickeroll Avatar asked Dec 16 '16 09:12

Pickeroll


1 Answers

Not the most elegant but:

#continue executing even if command fails
RUN dpkg -i vufind_3.1.1.deb || true
like image 102
CTodea Avatar answered Sep 18 '22 18:09

CTodea