Giter Site home page Giter Site logo

Can't build in Docker about shhgit HOT 6 OPEN

chenboy3 avatar chenboy3 commented on June 8, 2024
Can't build in Docker

from shhgit.

Comments (6)

jcmoneymx avatar jcmoneymx commented on June 8, 2024 7

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 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

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

from shhgit.

takionExMachina avatar takionExMachina commented on June 8, 2024

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

from shhgit.

chenboy3 avatar chenboy3 commented on June 8, 2024

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

from shhgit.

takionExMachina avatar takionExMachina commented on June 8, 2024

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 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

from shhgit.

chenboy3 avatar chenboy3 commented on June 8, 2024

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

from shhgit.

mr-pmillz avatar mr-pmillz commented on June 8, 2024

@jcmoneymx your last comment worked like a charm! 💯
Kudos

from shhgit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.