mcuadros / OctoPrint-TFT

A OctoPrint touch interface for TFT touch modules based on GTK+3
GNU Affero General Public License v3.0
171 stars 79 forks source link

docker image is broke on jessie #63

Open synman opened 5 years ago

synman commented 5 years ago

I pulled down source tonight to make some changes and found the docker image has some issues resolving apt targets. I've encountered this before (it's due to jessie getting mothballed) and figured I'd share here for others wanting to build directly on their pi with an octopi distro.

Use the following for your Dockerfile:

ARG IMAGE
FROM ${IMAGE}

ARG GO_TAGS
ENV GO_TAGS=${GO_TAGS}

RUN echo "deb [check-valid-until=no] http://cdn-fastly.deb.debian.org/debian jessie main" > /etc/apt/sources.list.d/jessie.list
RUN echo "deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list
RUN sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list
RUN apt-get -o Acquire::Check-Valid-Until=false update

RUN apt-get -o Acquire::Check-Valid-Until=false update && apt-get -o Acquire::Check-Valid-Until=false install -y --no-install-recommends \
  git build-essential \
  debhelper devscripts fakeroot git-buildpackage dh-make dh-systemd dh-golang \
  libcairo2-dev \
  libgtk-3-dev

# We cache go get gtk, to speed up builds.
#RUN go get -tags ${GO_TAGS} -v github.com/gotk3/gotk3/gtk/...

ADD . ${GOPATH}/src/github.com/mcuadros/OctoPrint-TFT/
#RUN go get -tags ${GO_TAGS} -v ./...

WORKDIR ${GOPATH}/src/github.com/mcuadros/OctoPrint-TFT/
SpeedyRS2 commented 5 years ago

I had the same problem.

I solved it, by making some dirty changes to the makefile. I changed the package properties from the jessie-part to the same values as the stretch properties. ` DEBIAN_PACKAGES = JESSIE STRETCH STRETCH_NAME := stretch STRETCH_IMAGE := golang:1.9-stretch STRETCH_GO_TAGS := gtk_3_22

JESSIE_NAME := stretch JESSIE_IMAGE := golang:1.9-stretch JESSIE_GO_TAGS := gtk_3_22 `

With this little changes I could compile the sourcecode under my debian stretch system.

synman commented 5 years ago

which I'm sure is great if you don't want the Jessie binaries.

I would go a step further and remove JESSIE from the DEBIAN_PACKAGES line. Will cut your build time in half.