mdatp install in Docker - docker

I am trying to install windows defender in a docker container.
But Facing the following error while Docker Build.
System has not been booted with systemd as init system (PID 1). Can't
operate. Failed to connect to bus: Host is down
Docker File :
FROM openjdk:11
RUN apt-get -y update
RUN apt-get -y install curl
RUN curl -o microsoft.list https://packages.microsoft.com/config/debian/10/prod.list
RUN mv ./microsoft.list /etc/apt/sources.list.d/microsoft-prod.list
RUN apt-get install -y gpg
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN apt-get install apt-transport-https
RUN apt-get -y update
RUN apt-get install -y systemd
RUN apt-get install -y mdatp

Related

Docker Compose: Apt-utils installation problem

I am trying to build a new image in Docker Compose but the following problem occurs
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/a/apt/apt-utils_2.4.7_amd64.deb 404 Not Found [IP: ]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
The command '/bin/sh -c apt-get install -y apt-utils' returned a non-zero code: 100
ERROR: Service 'nginx-service' failed to build : Build failed
In my Dockerfile I'm running: RUN apt-get install -y apt-utils and with --fix-missing.
None of the related questions or other solutions helped me and I've been stuck for quite a while. What am I missing?
Thanks!
EDIT: The whole Dockerfile
FROM ubuntu:latest
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y nginx
RUN apt-get clean
RUN apt-get install -y curl
RUN apt-get install -y unzip
RUN apt-get install -y wget
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
RUN apt-get install -y php php-xml php-curl php-fpm php-mysql
RUN apt-get install -y apt-utils --fix-missing
RUN apt-get install -y php-zip --fix-missing
RUN apt-get install -y php-gd --fix-missing
RUN apt-get install -y mysql-server
RUN curl -sS https://getcomposer.org/installer -o composer-setup.php
RUN php composer-setup.php --install-dir=/usr/local/bin --filename=composer
RUN apt-get install -y nano
RUN apt-get install -y mc
RUN apt-get install -y systemctl
RUN systemctl start nginx.service
usually , when we are building a new image, we use update then install like this
RUN apt-get update && apt-get install -y apt-utils
This will update apt source list and will make the package available to install.
Addibg this to your Dockerfile should fix the issue.
If you want to install many at once you can add the packages like the following :
RUN apt-get update && apt-get install -y \
bzr \
cvs \
git \
mercurial \
subversion \
Building the image like this:
docker-compose build --no-cache
worked for me

Docker from running container "bash:docker:command not found"

I am trying to run docker commands from inside my container, but I always get the response "bash: docker: command not found". I've built my image successfully, and run it by trying the following two ways: docker run -it ubuntu bash and docker run -it ubuntu. All is good running the image, however when I try to execute a shell script by doing the following: docker exec ubuntu /path/to/script.sh, I receive the "command not found" error. Here is my Dockerfile:
# syntax=docker/dockerfile:1
FROM ubuntu:focal
WORKDIR /home/mark/Downloads/docker
ENV TZ=America/New_York
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt update && apt -y upgrade
RUN apt -y install software-properties-common wget
RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test
RUN add-apt-repository -y ppa:cybermax-dexter/mingw-w64-backport
RUN wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | apt-key add -
RUN wget -qO /etc/apt/sources.list.d/lunarg-vulkan-1.3.204-focal.list https://packages.lunarg.com/vulkan/1.3.204/lunarg-vulkan-1.3.204-focal.list
RUN apt update && apt -y upgrade
RUN apt -y install build-essential mingw-w64 gcc-11-multilib g++-11-multilib nano sudo vulkan-sdk
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 90 && update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 90
RUN update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
RUN update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
RUN update-alternatives --set i686-w64-mingw32-gcc /usr/bin/i686-w64-mingw32-gcc-posix
RUN update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix
RUN dpkg --add-architecture i386
RUN wget -qO - https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_20.04/Release.key | apt-key add -
RUN sh -c "echo 'deb https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_20.04/ ./' >> /etc/apt/sources.list.d/OBS_WineHQ.list"
RUN sed -i 's/# deb-src/deb-src/g' /etc/apt/sources.list
RUN apt update
RUN apt -y build-dep wine
RUN apt -y install libusb-1.0-0-dev libusb-1.0-0-dev:i386 libgcrypt20-dev libx11-dev libx11-dev:i386 libfreetype-dev libfreetype-dev:i386 samba-dev
RUN apt -y install libxpresent-dev libxpresent-dev:i386 libxi-dev:i386 libxcursor-dev:i386 libxxf86vm-dev:i386 libxinerama-dev:i386 libxcomposite-dev:i386
RUN apt -y install libosmesa6-dev:i386 ocl-icd-opencl-dev:i386 libpcap0.8-dev:i386 libdbus-1-dev:i386 libgnutls28-dev:i386 libsane-dev:i386 libgphoto2-dev:i386
RUN apt -y install libpulse-dev:i386 libgstreamer1.0-dev:i386 libudev-dev:i386 libsdl2-dev:i386 libcups2-dev:i386 libv4l-dev:i386 libfontconfig1-dev:i386
RUN apt -y install libgstreamer-plugins-base1.0-dev:i386 libkrb5-dev:i386 libopenal-dev:i386 libvulkan-dev:i386 libldap2-dev:i386 libcapi20-dev:i386
The docker docs say what I am doing should work. What gives?

Can't access port 8080, 50000 and 8888 while installing jenkins and jupyter

I am new to dokers. I need jenkins and jupyter notebook in the same container. I have written the following Dockerfile but I can't access localhost:8888 or 8080 or 50000 when I run this image. However, these ports work very well when I run the official jenkins image. So, I don't know where I am making the mistake in my Dockerfile.
# using ubuntu as base image
FROM ubuntu:20.04
# installing python version 3.8
RUN apt-get update -y \
&& apt-get install -y apt-utils \
&& apt-get install python3.8 -y
# installing jupyter notebook
RUN apt-get install jupyter -y
EXPOSE 8888
# installing jenkins
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get install dialog apt-utils -y
RUN apt-get update && apt-get install -y gnupg2
RUN apt-get install -y wget
RUN wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | apt-key add -
RUN sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > \
/etc/apt/sources.list.d/jenkins.list'
RUN apt-get update
RUN apt-get install jenkins -y
EXPOSE 50000 8080
# removing unnecessary files
RUN rm -rf /var/lib/apt/lists/*
COPY sample.py .
LABEL maintainer=Ammar
CMD ["bash"]

Why am I getting Unable to correct problems, you have held broken packages

Trying to run Dockerfile and it fails at installing npm.
ERROR:
Unable to correct problems, you have held broken packages.
The command '/bin/sh -c apt-get install -y npm' returned a non-zero code: 100
Dockerfile:
FROM ubuntu:14.04
MAINTAINER Giacomo Vacca "giacomo.vacca#gmail.com"
ENV REFRESHED_AT 2015-01-19
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get autoremove
RUN npm -v
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install --yes curl
RUN curl --silent --location http://deb.nodesource.com/setup_0.10 | sudo bash -
RUN apt-get install -y nodejs
RUN apt-get install --yes build-essential
RUN rm /usr/bin/node
# needs this to find the nodejs exec
RUN ln -s /usr/bin/nodejs /usr/bin/node
RUN apt-get install -y npm <--- FAIL
RUN /usr/bin/npm install socket.io#0.9.14
EXPOSE 8080
ENTRYPOINT ["/usr/bin/node", "/root/server.js"]
You don't need to install npm from the ubuntu distribution with:
RUN apt-get install -y npm
because it's already installed by the nodejs package from nodesource. You can check it with:
dpkg -L nodejs | grep "/usr/bin/npm"

Supervisor is not starting up

I am following cloudera cdh4 installation guide.
My base file
FROM ubuntu:precise
RUN apt-get update -y
#RUN apt-get install -y curl
RUN apt-get install -y software-properties-common python-software-properties
RUN add-apt-repository ppa:webupd8team/java
RUN apt-get update -y
RUN echo debconf shared/accepted-oracle-license-v1-1 select true | \
debconf-set-selections
RUN apt-get install -y oracle-java7-installer
#Checking java version
RUN java -version
My hadoop installation file
java_ubuntu is the image build from my base file.
FROM java_ubuntu:latest
RUN apt-get update -y
RUN apt-get install -y curl
RUN curl http://archive.cloudera.com/cdh4/one-click-install/precise/amd64/cdh4-repository_1.0_all.deb > cdh4-repository_1.0_all.deb
RUN dpkg -i cdh4-repository_1.0_all.deb
RUN curl -s http://archive.cloudera.com/cdh4/ubuntu/precise/amd64/cdh/archive.key | apt-key add -
RUN apt-get update -y
RUN apt-get install -y hadoop-0.20-conf-pseudo
#Check for /etc/hadoop/conf.pseudo.mrl to verfiy hadoop packages
RUN echo "dhis"
RUN dpkg -L hadoop-0.20-conf-pseudo
Supervisor part
hadoop_ubuntu is the image build from my hadoop installation docker file
FROM hadoop_ubuntu:latest
USER hdfs
RUN hdfs namenode -format
USER root
RUN apt-get install -y supervisor
RUN echo "[supervisord] nodameon=true [program=namenode] command=/etc/init.d/hadoop-hdfs-namenode -D" > /etc/supervisorconf.d
CMD ["/usr/bin/supervisord"]
Program is successfully build. But namenode is not starting up? How to use supervisor?
You have your config in /etc/supervisorconf.d and I don't believe that's the right location.
It should be /etc/supervisor/conf.d/supervisord.conf instead.
Also it's easier to maintain if you make a file locally and then use the COPY instruction to put it in the image.
Then as someone mentioned you can connect to the container after it's running (docker exec -it <container id> /bin/bash) and then run supervisorctl to see what's running and what might be wrong.
Perhaps you need line breaks in your supervisor.conf. Try hand crafting one and COPY it into your dockerfile for testing.
Docker and supervisord

Resources