foggycam icon indicating copy to clipboard operation
foggycam copied to clipboard

Docker Image doesn't seem to work

Open cjsfj opened this issue 6 years ago • 9 comments

Does anyone actually have this docker file working? I'm curious as to the changes needed. I've iterated over fixing errors for a few hours now and no-go.

Thanks,

CJ

cjsfj avatar Sep 24 '18 03:09 cjsfj

Same issue but if you check Dockerfile, you can view this project is not finish ;)

`FROM ubuntu:16.04 # Install. RUN
sed -i 's/# (.multiverse$)/\1/g' /etc/apt/sources.list &&
apt-get update &&
apt-get -y upgrade &&
apt-get install -y build-essential &&
apt-get install -y software-properties-common &&
apt-get install -y byobu curl git htop man unzip vim wget &&
apt-get install -y ffmpeg &&
apt-get install -y python-pip python-dev &&
pip install --upgrade pip &&
rm -rf /var/lib/apt/lists/

Set environment variables. ENV HOME /root # Define working directory. WORKDIR /root

Define default command. CMD ["bash"]

ADD src/ ./src ADD config.json ./ ENTRYPOINT cd src && pip install -r requirements.txt && python start.py && /bin/bash`

CLARENNE-Q avatar Sep 25 '18 02:09 CLARENNE-Q

This is why I asked to see if anyone had made progress.

Would rather not install a bunch of custom crap on my Mac. But if I must, I must.

cjsfj avatar Sep 29 '18 02:09 cjsfj

The Dockerfile is indeed work in progress. It's something that I need to address, but it's lower priority compared to other work. For the time being, I am flagging it as good-first-issue and help-wanted if anyone wants to pick it up.

dend avatar Nov 29 '18 07:11 dend

Dockerfile should look like

# Pull base image.
#FROM ubuntu:16.04
FROM python:3

# Install.
RUN \
  sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \
  apt-get update && \
  apt-get -y upgrade && \
  apt-get install -y build-essential && \
  apt-get install -y software-properties-common && \
  apt-get install -y byobu curl git htop man unzip vim wget && \
  apt-get install -y ffmpeg && \
  apt-get install -y python-pip python-dev && \
  pip install --upgrade pip && \
  rm -rf /var/lib/apt/lists/*

ADD src/requirements.txt /root  
RUN pip install -r /root/requirements.txt
# Set environment variables.
ENV HOME /root

# Define working directory.
WORKDIR /root

# Define default command.
CMD ["bash"]

ADD src/ ./src
ADD config.json ./

ENTRYPOINT cd src  && python start.py && /bin/bash

ldb2000 avatar Feb 02 '19 19:02 ldb2000

@ldb2000 Awesome thank you.

Out of curiosity, why did you choose to set bash as the default command? Would you not want to start foggy cam instead of a shell?

CJ

cjsfj avatar Feb 02 '19 21:02 cjsfj

@cjsfj , I am changing the Dockerfile with an alpine image (lighter). I will change also the entrypoint (CMD should not be necessary). I will do a merge request when I am ready (should be soon)

ldb2000 avatar Feb 05 '19 20:02 ldb2000

This image should be better. Light (alpine python image). removing CMD and bash (not needed). I have removed lots of unnecessary package (man, curl, ...) as well. The size of the image was 1.3G and now 331MB .

FROM python:alpine
# Install.
RUN \
  apk add --update && \
  apk add  --no-cache build-base  py-pip  libffi-dev openssl-dev py-pip  && \
  pip install --upgrade pip && \
  rm -rf /var/cache/apk/* 

ADD ./src/ /apps/src
ADD ./config.json /apps/

RUN pip3 install -r /apps/src/requirements.txt
# Set environment variables.
ENV HOME /root

# Define working directory.
WORKDIR /apps/src

ENTRYPOINT ["python", "start.py"] 

Need to be tested

ldb2000 avatar Feb 05 '19 20:02 ldb2000

@dend I have made a pull request.

ldb2000 avatar Feb 06 '19 07:02 ldb2000

Wanted to update you folks on this issue - I will actually be creating a new Docker image for the .NET implementation of this project. It needs to be updated from the previous version. My goal is to get this done in the coming month.

dend avatar Mar 06 '21 00:03 dend