Dockerfile - Debian apt-get php-xdebug failing - xdebug

I am trying to create a docker image that has the following:
php7
apache2
git
xdebug
In my dockerfile I have the official php7 with apache image as the base.
I can run apt-get update.
I have installed git successfully.
But when I run apt-get install -y php-xdebug I get the following:
E: Unable to locate package php-debug
Dockerfile:
FROM php:7.0-apache
RUN apt-get update && apt-get install -y git
RUN apt-get install -y php-xdebug

Related

docker compose not starting 2 applications in 2 different location on same server

i have UAT and production setup on same server with identical code only the backend service is exposed on different ports.
i use the docker-compose up --build to start the application
but i am unable to start the uat and production application at same time.
first i go to the uat folder and run docker-compose up --build the application starts and same is visible in docker ps as well
but then i go to prod folder and issue docker-compose up --build it starts the service but the uat service goes down automatically
ideally when the code is in 2 different places it should behave as 2 different application and should be independent but its not happening.
docker-compose.yml
version: "2.2"
services:
webbackend:
build: .
network_mode: "host"
container_name: atms-webapp-backend-test
restart: always
volumes:
- .:/code
command:
"python3.7 app.py --port=5002"
# "gunicorn --workers=2 --bind=0.0.0.0:9000 utootuweb.wsgi:application"
Dockerfile
FROM ubuntu:18.04
WORKDIR /code
ADD . /code
RUN apt-get update && apt-get upgrade -y && apt-get clean
ENV NODE_VERSION=16.16.0
RUN apt-get install -y curl
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
ENV NVM_DIR=/root/.nvm
RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION}
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}"
RUN node --version
RUN npm --version
WORKDIR /code/frontend
RUN npm install
RUN npm run build
# RUN npm install -g serve
# RUN serve -s build
# RUN yarn
# RUN yarn build
# # Upgrade installed packages
# RUN apt-get update && apt-get upgrade -y && apt-get clean
# # Python package management and basic dependencies
#
# RUN apt-get install -y curl python3.7 python3.7-dev python3.7-distutils curl
# # node install
# RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -
# RUN apt-get install -y nodejs
# # npm install
# RUN apt install -y npm
# RUN npm install -g npm#latest
#
# Python package management and basic dependencies
RUN apt-get install -y curl python3.7 python3.7-dev python3.7-distutils
# Register the version in alternatives
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.7 1
# Set python 3 as the default python
RUN update-alternatives --set python /usr/bin/python3.7
RUN apt-get install -y build-essential python3.7 python3.7-dev python3-pip python3.7-venv libgl1
RUN apt-get install -y git
# update pip
RUN python3.7 -m pip install pip --upgrade
RUN python3.7 -m pip install wheel
# build frontend
# WORKDIR /code/frontend
#
# RUN npm install
# RUN npm run build
# install backend code
WORKDIR /code
RUN python3.7 -m pip install -r requirements.txt
WORKDIR /code/backend
CMD ["python3" ,"app.py"]
i have the same code base in 2 folders uat and prod
only the port is different
docker --version
Docker version 20.10.10, build b485636
docker-compose --version
docker-compose version 1.29.2, build 5becea4c
I changed the container name in docker-compose.yml to unique name for uat and prod as well just to make sure that container name is not the issue

Docker timeout error mssql17 connection on M1 arm64 architecture

Could you please help me resolve this issue:
I must to say that everything is working fine on Windows amd64 architecture
But when I tried to start docker-compose on arm64 M1 it went wrong and makes the error
So I have these 2 Dockerfiles
FROM --platform=linux/amd64 python:3.9-buster as builder
WORKDIR ...
COPY ...
RUN apt-get update && apt-get install -y git g++ libgirepository1.0-dev unixodbc unixodbc-dev pkg-config libcairo2-dev gcc python3-dev
RUN pip install virtualenv &&\
python -m venv antenv
RUN . antenv/bin/activate &&\
python -m ensurepip --upgrade &&\
pip install --upgrade pip &&\
pip install wheel gobject PyGObject &&\
pip install -r requirements.txt
FROM --platform=linux/amd64 python:3.9-slim
WORKDIR ...
COPY --from=builder ...
RUN apt-get update && apt-get install curl gnupg -y
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - &&\
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list > /etc/apt/sources.list.d/mssql-release.list &&\
apt-get update &&\
ACCEPT_EULA=Y apt-get install msodbcsql17 mssql-tools -y &&\
apt-get install -y unixodbc python3-gi gir1.2-secret-1 alembic &&\
. antenv/bin/activate && pip install gunicorn &&\
mkdir -p /opt/antenv/nltk_data
EXPOSE 5000
CMD . antenv/bin/activate && alembic -x data=true upgrade head && gunicorn wsgi:app -w 1 --worker-class eventlet --threads 2 --forwarded-allow-ips=* -b 0.0.0.0:5000
and DataBase:
FROM --platform=linux/amd64 mcr.microsoft.com/mssql/server:2017-latest
WORKDIR /opt/mssql/
# Bundle config source
COPY ./*.sh /opt/mssql/bin/
RUN chmod +x /opt/mssql/bin/*.sh
ENTRYPOINT ["./bin/entrypoint.sh"]
CMD ["tail -f /dev/null"]
As you can see I mentioned everywhere that it is linux/amd64 platform
DataBase is upping good and I don`t get eerors
But when I up Backend, It as if does not see database and I get timeout error
backend | sqlalchemy.exc.OperationalError: (pyodbc.OperationalError) ('HYT00', '[HYT00] [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired (0) (SQLDriverConnect)')
backend | (Background on this error at: https://sqlalche.me/e/14/e3q8)

installing R 4.0.2 in ubuntu 18.04

I am trying to install R version 4.0.2 on ubuntu 18.04 but it shows this message:
The following packages have unmet dependencies:
r-base : Depends: r-base-core (>= 4.0.3-1.2004.0) but it is not going to be installed
Depends: r-recommended (= 4.0.3-1.2004.0) but it is not going to be installed
Recommends: r-base-html but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
You have to remove problematic PPA (it does no publish packages for 18.04 LTS - bionic) first with:
sudo add-apt-repository -r ppa:grass/grass-stable
and then update your package lists
sudo apt-get update
and install new updates with their dependencies by
sudo apt-get dist-upgrade
You have added R 3.5 repository (see bionic-cran35 in its URL), instead of needed R 4.0 (bionic-cran40). You have to remove wrong repository with
sudo add-apt-repository -r 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'
and then add correct one:
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/'
sudo apt-get dist-upgrade
sudo apt-get install r-base r-base-core r-recommended
In order to install the last R version in Ubuntu LTS >= 16.04. (amongst other 18.04) follow the instructions at CRAN. If you have already installed the distro version of R remove it with the package manager.
Here, I made a summarized version of the instructions.
Note that this instructions are valid for any LTS. I tried them with 18.04. and worked smoothly.
update indices
sudo apt update -qq
install two helper packages we need
sudo apt install --no-install-recommends software-properties-common dirmngr
Add the signing key (by Michael Rutter) for these repos
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
Add the R 4.0 repo from CRAN
sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
Install R and its dependences
sudo apt install --no-install-recommends r-base
Ready, you can execute R by just entering R on your terminal.

How to install boto3 on Ubuntu 18.04?

How do you install boto3 on Ubuntu 18.04?
I tried this:
# pip install boto3
Command 'pip' not found, but can be installed with:
apt install python-pip
# apt install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python-pip
#
Partial answer found at https://askubuntu.com/questions/672808/sudo-apt-get-install-python-pip-is-failing
sudo apt-get install software-properties-common
sudo apt-add-repository universe
sudo apt-get update
sudo apt-get install python3-pip
Do not run pip install --upgrade pip, otherwise the following steps are also needed:
from https://github.com/pypa/pip/issues/5240
vi /usr/bin/pip3
change the broken from pip import main import to
from pip._internal import main
and then finally
pip3 install boto3
it's quite simple, just install it from the terminal
apt install python-boto3
The log you posted informs you that the commands pip and python-pip are not already installed. So, if you still use python 2 (do not recommend), you can install pip or python-pip
sudo apt-get install pip
sudo apt-get install python-pip
and then install boto3: sudo pip install boto3.
Otherwise, if you already use Python 3, you can just install pip3 or python3-pip
sudo apt-get install pip3
sudo apt-get install python3-pip
and then install boto3: sudo pip3 install boto3

unable execute arm-cc on docker images ( ubuntu 12.04 base )

i want execute arm-cc binary on docker images (ubuntu 12.04 base)
but can't
the process was below ...
download arm CC using wget ( https://launchpad.net/linaro-toolchain-binaries/trunk/2013.10/+download/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux.tar.xz )
uncompress the file
execute arm cc (arm-linux-gnueabi-gcc)
arm cc file is symbolic link
arm-linux-gnueabihf-gcc -> arm-linux-gnueabihf-gcc-4.8.2
and error occurred ...
gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-gcc: Command not found
what should I do ?
Docker file contents is below
Ubuntu as base image
FROM ubuntu:12.04
MAINTAINER ...
update ubuntu image
RUN apt-get update
install essential package
RUN apt-get -y install vim
RUN apt-get -y install wget
RUN apt-get -y install bzip2
RUN apt-get -y install git
RUN apt-get -y install patch
RUN apt-get -y install make
RUN apt-get -y install kernel-package libncurses5-dev fakeroot wget bzip2 build-essential udev
set environment variable so I know I'm in a container
ENV ARM_CROSS_COMPILER TRUE
End Dockerfile
SOLVED
my machine is 64-bit and armcc executable is 32-bit.
when i was execute it on native linux, not occurs problem.
but on docker, error occurred. i tried 64-bit compiler execution, well
running.

Resources