Can't build in Docker
Hi, I can run the Go build fine, but wanted to run the Docker build as a comparison but keep running into the following error:
#5 65.63 dpkg-deb: building package 'nginx-dbg' in '../nginx-dbg_1.20.2-1~buster_arm64.deb'.
#5 65.63 dpkg-deb: building package 'nginx' in '../nginx_1.20.2-1~buster_arm64.deb'.
#5 67.84 dpkg-genbuildinfo --build=binary
#5 67.96 dpkg-genchanges --build=binary >../nginx_1.20.2-1~buster_arm64.changes
#5 68.06 dpkg-genchanges: info: binary-only upload (no source code included)
#5 68.06 dpkg-source --after-build .
#5 68.11 dpkg-buildpackage: info: binary-only upload (no source included)
#5 68.11 mv: cannot stat 'nginx_1*~buster_amd64.deb': No such file or directory
------
failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c apt-get update -y && apt-get install --no-install-recommends -y wget git unzip lsb-release gnupg2 dpkg-dev ca-certificates && echo "deb-src http://nginx.org/packages/`lsb_release -is | tr '[:upper:]' '[:lower:]'` `lsb_release -cs` nginx" | tee /etc/apt/sources.list.d/nginx.list && wget http://nginx.org/keys/nginx_signing.key && apt-key add nginx_signing.key && rm nginx_signing.key && cd /tmp && apt-get update && apt-get source nginx && apt-get build-dep nginx --no-install-recommends -y && git clone https://github.com/wandenberg/nginx-push-stream-module.git nginx-push-stream-module && cd nginx-1* && sed -i "s@--with-stream_ssl_module@--with-stream_ssl_module --add-module=/tmp/nginx-push-stream-module @g" debian/rules && dpkg-buildpackage -uc -us -b && cd .. && mv nginx_1*~buster_amd64.deb nginx.deb]: exit code: 1
Any suggestions here? I'm building on an M1 Mac for details.
Hi @chenboy3,
you need to set platform to linux/x86_64 like the following:
version: '2.4'
services:
shhgit-www:
platform: linux/x86_64
build: ./www
container_name: shhgit.www
ports:
- 8080:80 # if you change your local port update public/script.js:1273
volumes:
- ./www/public:/usr/share/nginx/html:ro
shhgit-app:
platform: linux/x86_64
build: ./
container_name: shhgit.app
entrypoint: ["/app/shhgit", "--live=http://shhgit-www/push"]
depends_on:
- shhgit-www
volumes:
- ./config.yaml:/app/config.yaml:ro
Hi, running into this issue now:
#10 16.53 ----------------------------------------------------------------------
#10 16.54 Unpacking nginx (1.22.0-1~buster) ...
#10 16.79 dpkg: dependency problems prevent configuration of nginx:
#10 16.79 nginx depends on libpcre2-8-0 (>= 10.32); however:
#10 16.79 Package libpcre2-8-0 is not installed.
#10 16.79
#10 16.79 dpkg: error processing package nginx (--install):
#10 16.79 dependency problems - leaving unconfigured
#10 16.80 Errors were encountered while processing:
#10 16.80 nginx
------
failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c apt-get update -y && apt-get install --no-install-recommends -y libssl1.1 lsb-base && dpkg -i /tmp/nginx.deb && apt-mark hold nginx]: exit code: 1
Any suggestions here? A bit unfamiliar with Docker so just not sure if I need to do some nginx installation configs
Hi @chenboy3,
I was able to reproduce the issue, this is related to the new debian version, as the required library is not supported anymore (not pretty sure, correct me if i am wrong). As a temporal fix you can do the following:
- After cloning the repo, go to
wwwdirectory and modify thedockerfileand set the following:
FROM debian:buster-slim AS builder
RUN apt-get update -y \
&& apt-get install --no-install-recommends -y wget git unzip lsb-release gnupg2 dpkg-dev ca-certificates \
&& echo "deb-src http://nginx.org/packages/`lsb_release -is | tr '[:upper:]' '[:lower:]'` `lsb_release -cs` nginx" | tee /etc/apt/sources.list.d/nginx.list \
&& wget http://nginx.org/keys/nginx_signing.key && apt-key add nginx_signing.key && rm nginx_signing.key \
&& cd /tmp \
&& apt-get update \
&& apt-get source nginx \
&& apt-get build-dep nginx --no-install-recommends -y \
&& git clone https://github.com/wandenberg/nginx-push-stream-module.git nginx-push-stream-module \
&& cd nginx-1* \
&& sed -i "s@--with-stream_ssl_module@--with-stream_ssl_module --add-module=/tmp/nginx-push-stream-module @g" debian/rules \
&& dpkg-buildpackage -uc -us -b \
&& cd .. \
&& mv nginx_1*~buster_amd64.deb nginx.deb
FROM debian:buster-slim AS runner
COPY --from=builder /tmp/nginx.deb /tmp
RUN apt-get update -y \
&& apt-get install --no-install-recommends -y lsb-base \
&& apt-get install wget -y \
&& wget http://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.1_1.1.1n-0+deb10u2_amd64.deb \
&& dpkg -i libssl1.1_1.1.1n-0+deb10u2_amd64.deb \
&& dpkg -i /tmp/nginx.deb \
&& apt-mark hold nginx
COPY nginx.conf /etc/nginx/nginx.conf
CMD ["nginx", "-g", "daemon off;"]
This will download and installlibssl1.1_1.1.1n-0+deb10u2_amd64.deb you can add a checksum step if you like.
After saving changes run into main directory aka SHHGIT run docker compose build, add your tokens modifying the config.yaml, and finally run docker-compose up, go to http://localhost:8080 and enjoy.
Regards @takionExMachina
Sounds good, this works! Is there a way to run docker-compose up with a local repository? Tried modifying the Dockerfile but that didn't seem to help
Hi @chenboy3,
I was able to reproduce the issue, this is related to the new debian version, as the required library is not supported anymore (not pretty sure, correct me if i am wrong). As a temporal fix you can do the following:
1. After cloning the repo, go to `www` directory and modify the `dockerfile` and set the following:FROM debian:buster-slim AS builder RUN apt-get update -y \ && apt-get install --no-install-recommends -y wget git unzip lsb-release gnupg2 dpkg-dev ca-certificates \ && echo "deb-src http://nginx.org/packages/`lsb_release -is | tr '[:upper:]' '[:lower:]'` `lsb_release -cs` nginx" | tee /etc/apt/sources.list.d/nginx.list \ && wget http://nginx.org/keys/nginx_signing.key && apt-key add nginx_signing.key && rm nginx_signing.key \ && cd /tmp \ && apt-get update \ && apt-get source nginx \ && apt-get build-dep nginx --no-install-recommends -y \ && git clone https://github.com/wandenberg/nginx-push-stream-module.git nginx-push-stream-module \ && cd nginx-1* \ && sed -i "s@--with-stream_ssl_module@--with-stream_ssl_module --add-module=/tmp/nginx-push-stream-module @g" debian/rules \ && dpkg-buildpackage -uc -us -b \ && cd .. \ && mv nginx_1*~buster_amd64.deb nginx.deb FROM debian:buster-slim AS runner COPY --from=builder /tmp/nginx.deb /tmp RUN apt-get update -y \ && apt-get install --no-install-recommends -y lsb-base \ && apt-get install wget -y \ && wget http://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.1_1.1.1n-0+deb10u2_amd64.deb \ && dpkg -i libssl1.1_1.1.1n-0+deb10u2_amd64.deb \ && dpkg -i /tmp/nginx.deb \ && apt-mark hold nginx COPY nginx.conf /etc/nginx/nginx.conf CMD ["nginx", "-g", "daemon off;"]This will download and install
libssl1.1_1.1.1n-0+deb10u2_amd64.debyou can add a checksum step if you like. After saving changes run into main directory akaSHHGITrundocker compose build, add your tokens modifying theconfig.yaml, and finally rundocker-compose up, go to http://localhost:8080 and enjoy.Regards @takionExMachina
Same error as @chenboy3 , above Dockerfile throws this error:
--2022-10-13 20:16:47-- http://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.1_1.1.1n-0+deb10u2_amd64.deb
Resolving security.debian.org (security.debian.org)... 151.101.194.132, 151.101.2.132, 151.101.130.132, ...
Connecting to security.debian.org (security.debian.org)|151.101.194.132|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2022-10-13 20:16:47 ERROR 404: Not Found.
My host debian version:
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
I replaced url with next one and it worked.: https://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.1_1.1.1n-0+deb10u3_amd64.deb
@jcmoneymx your last comment worked like a charm! 💯 Kudos