ERROR: unsatisfiable constraints: so:libvpx.so.6 (missing) - ffmpeg

FFMpeg was updated this week and is causing the build to break.
Are my options to either:
pin ffmpeg to a previous version? If so, how do I pin to the version before current?
Update the python dockerfile version
Output:
Step 8/42 : RUN apk add --no-cache ffmpeg
---> Running in 9e46540ed393
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
fetch http://dl-8.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
so:libvpx.so.6 (missing):
required by:
ffmpeg-libs-4.1.1-r2[so:libvpx.so.6]
ffmpeg-libs-4.1.1-r2[so:libvpx.so.6]
ffmpeg-libs-4.1.1-r2[so:libvpx.so.6]
ffmpeg-libs-4.1.1-r2[so:libvpx.so.6]
ffmpeg-libs-4.1.1-r2[so:libvpx.so.6]
ffmpeg-libs-4.1.1-r2[so:libvpx.so.6]
ffmpeg-libs-4.1.1-r2[so:libvpx.so.6]
ffmpeg-libs-4.1.1-r2[so:libvpx.so.6]
ffmpeg-libs-4.1.1-r2[so:libvpx.so.6]
ffmpeg-libs-4.1.1-r2[so:libvpx.so.6]
The command '/bin/sh -c apk add --no-cache ffmpeg' returned a non-zero code: 3
ERROR: Job failed: exit code 3
FATAL: exit code 3
Dockerfile:
FROM python:3.6.7-alpine
ENV LANG C.UTF-8
RUN echo "http://dl-8.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
RUN apk upgrade
RUN addgroup -S django && adduser -S -G django django
RUN apk update
# FFMPEG/Sox dependencies
RUN apk add sox
#RUN apk add --no-cache libvpx-dev
RUN apk add --no-cache ffmpeg

You are only adding the community edge repository, not main. This leads to some inconsistencies for apk.
It works if you change your Dockerfile:4 to the following:
RUN echo -e "http://dl-cdn.alpinelinux.org/alpine/edge/community\nhttp://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories

Related

Unable to install package libc6-compat on windows

I am building a docker image and it will not install libc6-compat on windows docker desktop. This is the full error:
#8 [deps 2/6] RUN apk add --no-cache libc6-compat
#8 sha256:190a4effb95700083113c7ec8bd34c90330cc8b70a393b16624e72fee8f0523d
#8 0.373 fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/main/x86_64/APKINDEX.tar.gz
#8 0.547 48EB05913A7F0000:error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1889:
#8 0.550 fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/community/x86_64/APKINDEX.tar.gz
#8 0.550 WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.17/main: Permission denied
#8 0.657 48EB05913A7F0000:error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1889:
#8 0.659 WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.17/community: Permission denied
#8 0.659 ERROR: unable to select packages:
#8 0.661 libc6-compat (no such package):
#8 0.661 required by: world[libc6-compat]
#8 ERROR: executor failed running [/bin/sh -c apk add --no-cache libc6-compat]: exit code: 1
------
> [deps 2/6] RUN apk add --no-cache libc6-compat:
------
executor failed running [/bin/sh -c apk add --no-cache libc6-compat]: exit code: 1
Here is the Dockerfile
# Install dependencies only when needed
FROM node:16-alpine AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
RUN apk add git
WORKDIR /app
# Install dependencies based on the preferred package manager
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc ./
RUN \
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
elif [ -f package-lock.json ]; then npm set-script prepare '' && npm ci --legacy-peer-deps; \
elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \
else echo "Lockfile not found." && exit 1; \
fi
# Rebuild the source code only when needed
FROM node:16-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
# Next.js collects completely anonymous telemetry data about general usage.
# Learn more here: https://nextjs.org/telemetry
# Uncomment the following line in case you want to disable telemetry during the build.
# ENV NEXT_TELEMETRY_DISABLED 1
RUN npm run build
# If using npm comment out above and use below instead
# RUN npm run build
# Production image, copy all the files and run next
FROM node:16-alpine AS runner
WORKDIR /app
ENV NODE_ENV production
# Uncomment the following line in case you want to disable telemetry during runtime.
# ENV NEXT_TELEMETRY_DISABLED 1
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
COPY --from=builder /app/public ./public
# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
USER nextjs
EXPOSE 3000
ENV PORT 3000
CMD ["node", "server.js"]

python-ldap 3.4 installation fails on alpine images

When trying to install the latest python-ldap version 3.4 on an apline docker image (I use python:3.9-alpine as my base image) the build of python-ldap fails with:
...
/usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lldap_r
collect2: error: ld returned 1 exit status
error: command '/usr/bin/gcc' failed with exit code
...
Installed dependencies:
apk add --no-cache --virtual .build-deps musl-dev gcc postgresql-dev openldap-dev libffi-dev
Also tried with build-base etc. without success.
Would highly appreciate any ideas :)
There are issues with the python-ldap package when linking against OpenLDAP 2.5+. The issues are acknowledged by the devs in https://github.com/python-ldap/python-ldap/issues/432 and https://github.com/python-ldap/python-ldap/issues/445.
Tested workaround is the one described in the first issue:
As a workaround create the file /usr/lib64/libldap_r.so with content
INPUT ( libldap.so ). The approach works on all systems that use a GNU
ld-compatible linker.
# cat > /usr/lib64/libldap_r.so << EOF
INPUT ( libldap.so )
EOF
You can also use it in a simpler way (in Dockerfiles, for example):
echo -n "INPUT ( libldap.so )" > /usr/lib/libldap_r.so

I am trying to make an apk its generated but with this error Execution failed for task ':app:bundleReleaseJsAndAssets'

Task :app:bundleReleaseJsAndAssets
Scanning folders for symlinks in C:\react-native\first_app\node_modules (109ms)
Scanning folders for symlinks in C:\react-native\first_app\node_modules (47ms)
warning: the transform cache was reset.
Loading dependency graph, done.
Unable to resolve module AccessibilityInfo from C:\react-native\first_app\node_modules\react-native\Libraries\react-native\react-native-implementation.js: Module AccessibilityInfo does not exist in the Haste module map
This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
1. Clear watchman watches: watchman watch-del-all.
2. Delete the node_modules folder: rm -rf node_modules && npm install.
3. Reset Metro Bundler cache: rm -rf /tmp/metro-bundler-cache-* or npm start -- --reset-cache. 4. Remove haste cache: rm -rf /tmp/haste-map-react-native-packager-*.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
Process 'command 'cmd'' finished with non-zero exit value 1
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 42s
12 actionable tasks: 1 executed, 11 up-to-date
As mentioned here, It may be because of you did not bundled correctly for android.
You can add following script
"bundle-android": "node node_modules/react-native/local-cli/cli.js bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/"
into scripts of your package.json
and the run npm run bundle-android
after that try running gradlew assembleRelease -x bundleReleaseJsAndAssets in android directory of your project. Hope it will solve your problem.

How to freeze micro version with dependencies?

I want to build a docker image with a fixed version of micro and go dependencies. I plan to do it with dep:
git checkout git#github.com:micro/micro.git
dep ensure
git add Gopkg.toml
git add Gopkg.lock
# Build micro
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' -i -o micro ./main.go
# Build docker image
...
So, my question is does it the best solution to build consistent micro docker image?
An example of a Dockerfile can be:
FROM golang:1.9-alpine3.6 as builder
# Install package manager
RUN apk add --no-cache --virtual .go-dependencies git curl \
&& curl https://glide.sh/get | sh
# Copy files from context
WORKDIR /go/src/github.com/foo/bar
COPY . .
# Install project dependencies, test and build
RUN glide install \
&& go test ./... \
&& CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' -i -o ./entry ./main.go ./plugins.go
# Build final image with binary
FROM alpine:3.6
RUN apk add --update ca-certificates && \
rm -rf /var/cache/apk/* /tmp/*
WORKDIR /
COPY --from=builder /go/src/github.com/foo/bar/entry .
ENTRYPOINT [ "/entry" ]
And the glide.yaml would look like this:
package: .
import:
- package: github.com/micro/go-micro
version: ^0.3.0
subpackages:
- client
- server
- package: github.com/micro/go-plugins
version: ^0.6.1
subpackages:
- wrapper/trace/opentracing
- broker/nats
- transport/nats
- package: github.com/opentracing/opentracing-go
version: ^1
- package: github.com/openzipkin/zipkin-go-opentracing
version: ^0.3
testImport:
- package: github.com/golang/mock
subpackages:
- gomock
- package: github.com/smartystreets/goconvey
subpackages:
- convey
In my case, dep looks great and fast enough, moreover, it's official dependency manager in go so I think it's a right choice.

How can I fix the following Google Cloud Platform deployment error? [Error 2]

I'm trying to deploy my web-app to Google Cloud Platform, and I got an error while deploying. I understand that last package (go-sqlite3) needs gcc compiler, and Google Cloud WM has it:
$which gcc
/usr/bin/gcc
but it won't work
Step 3 : RUN go-wrapper install -tags appenginevm
---> Running in b0f03024342d
+ exec go install -v -tags appenginevm
github.com/mattn/go-colorable
github.com/mattn/go-isatty
github.com/labstack/gommon/color
github.com/valyala/fasttemplate/vendor/github.com/valyala/bytebufferpool
github.com/valyala/fasttemplate
github.com/labstack/gommon/log
golang.org/x/crypto/acme
golang.org/x/crypto/acme/autocert
github.com/labstack/echo
golang.org/x/net/context
github.com/mattn/go-sqlite3
# github.com/mattn/go-sqlite3
exec: "gcc": executable file not found in $PATH
The command '/bin/sh -c go-wrapper install -tags appenginevm' returned a non-zero code: 2
ERROR
ERROR: build step "gcr.io/cloud-builders/docker#sha256:926dc1a14e6f7eb5b3462b5c1d491aa6c73090291167ac2bf181c026b05f19da" failed: exit status 2
You have to make your path correct by following command on your shell.
PATH=/usr/bin:$PATH

Resources