Cannot use '--build-native-deps' along with '--build' flag - azure

I'm getting the above error from an Azure DevOps pipeline while deploying python code to Azure functions. The pipeline was previously running without errors (last run 12 days ago). The task code is as follows;
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-$(lsb_release -cs)-prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-get update
sudo apt-get install azure-functions-core-tools
func azure functionapp publish <app-name> --python --build-native-deps
The last line is throwing the error, but there is no "--build" flag specified, which is is confusing me. Any suggestions?

So seems there is a behavior change on the function core tools after version 2.7.1585-1. The deployment works by removing the "--build-native-deps" flag.

Related

jenkins installation on wsl ubuntu issue

wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt update
sudo apt install jenkins
these commands are not working fine when I'm running this im getting:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package jenkins is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'jenkins' has no installation candidate
How can i install jenkins in wsl ubuntu
Follow the below steps.
First install certificates for WSL environment.
sudo apt install ca-certificates
Then Install Jenkins.
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo tee \
/usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get install jenkins
Note: If you have docker running it's better to start Jenkins as a Docker container.

Docker run bash node: command not found [duplicate]

This question already has answers here:
Why `~/.bashrc` is not executed when run docker container?
(4 answers)
Closed 5 months ago.
I've the following Dockerfile
FROM ubuntu:latest
WORKDIR /
# Without interactive dialogue
ARG DEBIAN_FRONTEND=noninteractive
# Install required packages
RUN apt-get update
RUN apt-get install -y wget gnupg2 software-properties-common git apt-utils vim dirmngr apt-transport-https ca-certificates zip
ENV NODE_VERSION=14
RUN wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash \
&& . .$HOME/.nvm/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default
# Install Wine from WineHQ Repository
RUN dpkg --add-architecture i386
RUN wget -qO- https://dl.winehq.org/wine-builds/Release.key | apt-key add -
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv F987672F
RUN apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main'
RUN apt-get update
RUN apt-get install -y --install-recommends winehq-stable
# Installing mono
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
RUN sh -c 'echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" > /etc/apt/sources.list.d/mono-official-stable.list'
RUN apt-get update
RUN apt-get install -y mono-complete
RUN PROJECT_DIR=/root/project
WORKDIR /project
Which allows me to build electron Apps in no matter what platform I'm on. Everything works well. Image building and also running it as a container works with no issues.
I then can go ahead and manually do the following:
#build the dockerfile
docker build -t debian-wine-electron-builder:0.1 .
#run the docker image as detached container
docker run -dt --name electron-build -v ${PWD}:/project debian-wine-electron-builder:0.1
#open a bash session in the container
docker exec -it electron-build bash
#and in there execute my commands which will build me the electron application
npm install ... #and so on
I now want to created a bash file to run all the commands making it easier to use. So one just has to run the bash file and it executes all the commands one by one.
When I want to use the docker run command followed by a `bash -c "command1 ; command2" I run into the following issue:
#building the image
docker build -t debian-wine-electron-builder:0.1 .
#docker run following commands
docker run --name electron-build -v ${PWD}:/project debian-wine-electron-builder:0.1 bash -c "npm install... ; command2 ..."
Gives me this error when trying to npm install:
bash: npm: command not found
When you run bash interactively, your .bashrc file will be run. When you run the command directly on the docker run command, bash is run non-interactively and .bashrc isn't run.
NVM uses .bashrc to set things up, so it needs to run.
You can force bash into interactive mode with the -i option. Then it'll work, but you'll get some warnings because it tries to do some terminal stuff that fails.
docker run --name electron-build -v ${PWD}:/project debian-wine-electron-builder:0.1 bash -i -c "npm install... ; command2 ..."
If you don't use nvm to switch node versions on the fly, it might be better to install the node version you want without using nvm.

Can't install pgadmin4 repository does not have file

I was use command
sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
But I was got this
Err:2 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/n/a pgadmin4 Release
404 Not Found [IP: 87.238.57.227 443]
Hit:3 https://community-packages.deepin.com/printer eagle InRelease
Hit:4 https://home-store-img.uniontech.com/appstore deepin InRelease
Reading package lists... Done
E: The repository 'https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/n/a pgadmin4 Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
So I can't install pgadmin
Use Deepin linux 20.2.3
I am using Linux mint, issue has been fixed using the below command.
$ sudo curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add
$ sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal pgadmin4 main" \
> /etc/apt/sources.list.d/pgadmin4.list && apt update'
$ sudo apt update
And then, if you want desktop
$ sudo apt install pgadmin4-desktop
OR the web version:
$ sudo apt install pgadmin4-web
$ sudo /usr/pgadmin4/bin/setup-web.sh
# apt-get install curl ca-certificates gnupg
# curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
#vim /etc/apt/sources.list.d/pgdg.list
####### ADD
#deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main
# apt-get update
# apt-get install pgadmin4 pgadmin4-apache2
It should now be successfully installed.
The problem is that lsb_release -cs is not returning the codename for Deepin linux, instead is returning n/a.
Try with that dpkg --status tzdata|grep Provides|cut -f2 -d'-' to retrive the codename.
If you want a oneliner like the one you posted, here you have:
sudo sh -c 'curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add && echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(dpkg --status tzdata|grep Provides|cut -f2 -d'-') pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
For Ubuntu 22.10 and other versions that complain about apt-key being deprecated, use this:
curl -fsS https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo gpg --dearmor -o /usr/share/keyrings/packages-pgadmin-org.gpg
sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/packages-pgadmin-org.gpg] https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/jammy pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
Note that "jammy" is being used here in the ftp link. You may browse through the other versions and pick the one that matches your Ubuntu installation's version
sudo apt install pgadmin4
This installs both web and desktop versions.
I experienced this error trying to upgrade my pgadmin4 to version 6. There was a problem with the certificates on my system I think, the solution was updating ca-certificates, if it's not installed you should probably install it, but that may be very unlikely that it's not installed though as it should already be there, but either way just run the command:
sudo apt install ca-certificates
I had the same problem with Debian 11, however exploring options I found this answer enter link description here and fixed the problem by installing lsb-release

How can I install libgdiplus apt package on Linux Azure Function startup command?

We have a .NET Core 3.1 function running on Linux Azure Function App, but because it uses System.Drawing library it depends on libgdiplus which is not installed in the default docker image, so the function fails.
I read a lot articles suggesting to add the following startup command in the Function App, but it's not working, it's simply not installing the package.
apt-get update && apt-get install -y --allow-unauthenticated apt-utils libc6-dev libgdiplus libx11-dev && rm -rf /var/lib/apt/lists/*
I saw this on the docker logs but still the package is not there.
docker run -d -p 8122:80 --name <image-name> -e WEBSITES_ENABLE_APP_SERVICE_STORAGE=true -e WEBSITE_SITE_NAME=<website-name> -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=<hostname> -e WEBSITE_INSTANCE_ID=<instanceId> -e HTTP_LOGGING_ENABLED=1 mcr.microsoft.com/azure-functions/dotnet:3.0-appservice-stage5 apt-get update && apt-get install -y --allow-unauthenticated apt-utils libc6-dev libgdiplus libx11-dev && rm -rf /var/lib/apt/lists/*
I can install the packages manually by opening a SSH sesion on the Azure Portal and running the command, and run the function succesfully, but obviousy next time it's restarted, the package is gone because the container is restarted as well.
Any other options or any help to troubleshoot this will be highly appreciated.
Thanks!
I think the proper way to do this would be to have your own custom Dockerfile that runs the apt-get commands you've provided.
Here's a snippet of what that would look like:
FROM mcr.microsoft.com/azure-functions/dotnet:3.0-appservice-stage5
RUN apt-get update \
&& apt-get install -y --allow-unauthenticated \
apt-utils \
libc6-dev \
libgdiplus \
libx11-dev \
&& rm -rf /var/lib/apt/lists/*
Further details on how to use custom Docker container with Azure Functions are found in the docs.

Install Docker Ubuntu 16.04 -- Not finding packages

My morning so far has been banging my head against trying to get the docker installation to work, so far I have had no luck.
The guide I have been following: https://docs.docker.com/install/linux/docker-ce/ubuntu/
Here is the steps of what happens.
First:
sudo apt-get remove docker docker-engine docker.io containerd runc
Which is good! The next step is a sudo apt-get update which returns something less good. A lot of documentation I have read does not seem to help me solve this, so I plug on to see if something will correct this later.
Third step is
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
No issues here.
Fourth step is the docker fingerprint key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Which just outputs OK
Fifth step I do is the sudo apt-key fingerprint 0EBFCD88 which outputs the key as it is shown in the docker installation documentation.
Sixth step is the repository:
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
No output is shown just brings me to a new command line.
Seventh step is sudo apt-get update which shows the same output as in step 2.
Eigth step is the actual install. sudo apt-get install docker-ce docker-ce-cli containerd.io
Which outputs:
I am not sure of what files to edit. But every line is spelled correctly and it still throws issues my way and I am at a loss. If anyone has any tips thatd be fantastic.
If you are not sure which steps error, I suggest you to ease the process of the docker install using official convenience script, see this:
Main steps as next:
$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh
Super simple way to install, as this is a common problem:
Download the most recent docker-ce, docker cli and container.d file from here:
https://download.docker.com/linux/ubuntu/dists/xenial/pool/stable/amd64/
Then just run dpkg -i <containerd package name> <docker-ce package name> <docker cli package name>
That's it, Docker away
sometimes it is blocked through the DNS, You can try by changing DNS address to 8.8.8.8.
you can change DNS address through /etc/resolve.conf temporarily
or if you need permanent you can change here /etc/resolvconf/resolv.conf.d/base

Resources