skip to Main Content

I want to create a dockerfile for a debian file extension which runs on ubuntu 18.04. So far I’ve written this

FROM ubuntu:18.04 AS ubuntu

RUN apt-get update

WORKDIR /Downloads/invisily

RUN apt-get install ./invisily.deb

All phases run fine except the last one. It shows this error:

E: Unsupported file ./invisily.deb given on commandline
The command '/bin/sh -c apt-get install ./invisily.deb' returned a non-zero code: 100

I’m new to docker and cloud so any help would be appreciated thanks!

Edit:
I solved it by putting the dockerfile and the debian file in the same directory and using COPY . ./
This is what my dockerfile looks like now:

FROM ubuntu:18.04 AS ubuntu

RUN apt-get update

WORKDIR /invisily

COPY . ./

USER root
RUN chmod +x a.deb && 
    apt-get install a.deb


2

Answers


  1. in your WORKDIR there isn’t any invisly.deb file, so if you have it you can copy it the container like this:

    FROM ubuntu ...
    WORKDIR /Downloads/invisily
    RUN apt-get update
    COPY ./your invisly file path ./
    RUN chmod +x ./invisily 
    RUN apt-get install ./invisily.deb
    
    Login or Signup to reply.
  2. A few things,

    • WORKDIR is the working directory inside of your container.
    • You will need to copy the file invisily.deb from locally to your container when building your Docker image.
    • You can pass multiple bash commands in the RUN field combining them with multilines.

    Try something like this

    FROM ubuntu:18.04 AS ubuntu
    WORKDIR /opt/invisily
    
    #Drop the invisily.deb in to the same directory as your Dockerfile
    #This will copy it from local to your container, inside of /opt/invisily dir
    COPY invisily.deb .
    
    RUN apt-get update && 
        chmod +x invisily.deb && 
        apt-get install invisily.deb
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search