riking / AutoDelete

A Discord bot that automatically deletes all messages in a designated channel on a rolling basis
Apache License 2.0
326 stars 118 forks source link

Dockerfile is failing to build #42

Closed samcro1967 closed 2 years ago

samcro1967 commented 2 years ago

Looking to self host to help lighten the load, but build is failing.

(Reading database ... 100%
(Reading database ... 15709 files and directories currently installed.)
Preparing to unpack .../linux-libc-dev_5.10.113-1_amd64.deb ...
Unpacking linux-libc-dev:amd64 (5.10.113-1) over (5.10.106-1) ...
Setting up linux-libc-dev:amd64 (5.10.113-1) ...
Processing triggers for libc-bin (2.31-13+deb11u3) ...

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
git is already the newest version (1:2.30.2-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

go: go.mod file not found in current directory or any parent directory.
    'go get' is no longer supported outside a module.
    To build and install a command, use 'go install' with a version,
    like 'go install example.com/cmd@latest'
    For more information, see https://golang.org/doc/go-get-install-deprecation
    or run 'go help get' or 'go help install'.
The command '/bin/sh -c apt update -y --allow-insecure-repositories && apt upgrade -y &&   apt install -y git &&   apt -y clean &&   go get -u -v github.com/riking/AutoDelete/cmd/autodelete' returned a non-zero code: 1
exit status 1
Exit Code 1
c1sxr0bzn commented 2 years ago

This has got to do with golang.

Update your Dockerfile to use to older version of golang:

FROM golang:1.13.15

RUN apt update -y --allow-insecure-repositories && apt upgrade -y && \ 
  apt install -y git && \
  apt -y clean && \
  go get -u -v github.com/riking/AutoDelete/cmd/autodelete

RUN mkdir -p /autodelete/data && \
  cp "/go/src/github.com/riking/AutoDelete/docs/build.sh" /autodelete/

ENV HOME=/

EXPOSE 2202

WORKDIR /autodelete/

ENTRYPOINT ./build.sh && ./autodelete
samcro1967 commented 2 years ago

That worked.