I am creating google cloud VM using rhel7 and install docker after try to build docker image using dockerfile image not build docker.
FROM rhel
RUN yum update -y
yum install -y \
java-1.8.0-openjdk \
java-1.8.0-openjdk-devel
ENV JAVA_HOME /etc/alternatives/jre
Error response from daemon: Unknown instruction: .
You can use,
FROM registry.access.redhat.com/rhel7/rhel
MAINTAINER John W. Jones <jjones#example.com>
# Add Web server, update image, and clear cache
RUN yum -y install httpd && yum -y update; yum clean all
# Add some data to web server
RUN echo "This Web server is working." > /var/www/html/index.html
EXPOSE 80
ENTRYPOINT [ "/usr/sbin/httpd" ]
CMD [ "-D", "FOREGROUND" ]
(ref.)
Related
I'm attempting to build a Docker image to provision this software: https://fragpipe.nesvilab.org/docs/tutorial_setup_fragpipe.html
This is my Dockerfile in its current state:
FROM amazonlinux:2022
ENV DISPLAY=:0
ENV JAVA_HOME=/usr/lib/jvm/java-17-amazon-corretto.x86_64
COPY FragPipe-19.0.zip .
COPY MSFragger-20171106.zip .
RUN yum update -y \
&& yum upgrade -y \
&& yum install -y unzip java-17-amazon-corretto
RUN rpmkeys --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" \
&& curl https://download.mono-project.com/repo/centos8-stable.repo | tee /etc/yum.repos.d/mono-centos8-stable.repo \
&& yum install -y mono-devel
RUN unzip MSFragger-20171106.zip \
&& rm MSFragger-20171106.zip
RUN unzip FragPipe-19.0.zip \
&& rm FragPipe-19.0.zip
RUN fragpipe/bin/fragpipe
However, for hours now I've run into errors like this:
Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.
I've tried multiple fixes, including using the official AWS corretto Docker image amazoncorretto:17-al2022-RC-headful, and manually installing the Java system dependencies. However, I continue to get this error.
Before I spend any more time troubleshooting this, I'm curious if the fact that I'm running this on EC2 has any effect on whether or not X11 will work?
I'm very much new to docker. I have a node application that process/read a java file. I'm trying to create a docker image that runs node and java. I node configs are working well but I'm always getting errors when building the docker file because of java - it shows
failed to compute cache key: "/japp.jar" not found: not found"
My Dockerfile contains:
FROM node:14.18.1
RUN apt-get update && apt-get -y upgrade
WORKDIR /code
EXPOSE 8443
COPY package.json /code/package.json
RUN npm install
COPY . /code
# Jave Config
FROM eclipse-temurin:11
RUN mkdir /opt/app
COPY japp.jar /opt/app
ENTRYPOINT ["java", "-jar", "/opt/app/japp.jar"]
CMD ["node","app.js"]
I was trying to follow the docs here but no luck.
In the past, I was using the following for Java config and that was working fine, but it shows some vulnerability so I need to switch to eclipse-temurin:11
# RUN echo 'deb http://ftp.debian.org/debian stretch-backports main' | tee /etc/apt/sources.list.d/stretch-backports.list
# RUN apt-get update && apt-get -y upgrade && \
# apt-get install -y openjdk-11-jre-headless && \
# apt-get clean;
I want to run this kurento example: https://doc-kurento.readthedocs.io/en/stable/tutorials/java/tutorial-one2one.html
But I have some issues with application server when I building it on docker.
When I run kms docker - it run's successfully. I setted port of kurento-media-server as 8889:8888 and IP in docker container when I checked was 172.17.0.2. Also, I setted port of web app as 8081:8080.
When i tried to open a web-page - it was not responded.
My url was: https://192.168.0.2:8443, where 192.168.0.2 is IP of my server where I run docker. Also I tried to connect to docker container IP directly with https://172.17.0.3:8443.
Here's my app dockerfile.
FROM ubuntu:16.04
MAINTAINER USER1 "USER1#infinte.com"
RUN apt-get update
RUN apt-get install git -y
RUN apt-get install curl -y
RUN apt install apt-utils -y
RUN apt install maven -y
RUN apt install openjdk-8-jdk openjdk-8-jre -y
RUN apt-get install software-properties-common -y
RUN git clone https://github.com/Kurento/kurento-tutorial-java.git
WORKDIR kurento-tutorial-java/kurento-one2one-call-advanced/
EXPOSE 8080
ENTRYPOINT mvn -U clean spring-boot:run -Dkms.url=ws://172.17.0.2:8888/kurento
Here's my kms run command:
docker run -t --name kms -p 8889:8888 kurento/kurento-media-server
Here's my app server run command:
docker run -d --name apps -p 8081:8080 --link kms apps
What mistakes I have made here? May'be I need to change IP in ENTRYPOINT?
I spent many weeks to find out the reason why it's not working.
To make everything work, I needed to add --network=host line in docker command.
Correct docker command is
docker run --network=host -t --name apps -p 8081:8080 apps
I successfully created and started this container :
https://github.com/puckel/docker-airflow
by running :
docker build --rm --build-arg AIRFLOW_DEPS="datadog,dask" --build-arg PYTHON_DEPS="flask_oauthlib>=0.9" -t puckel/docker-airflow .
docker-compose -f docker-compose-CeleryExecutor.yml up -d
Then i just wanted to add java to images :
I added at the end :
https://github.com/puckel/docker-airflow/blob/master/Dockerfile#L83
USER airflow
WORKDIR ${AIRFLOW_USER_HOME}
ENTRYPOINT ["/entrypoint.sh"]
CMD ["webserver"] # set default arg for entrypoint
# my new code :
USER root
RUN mkdir -p /usr/share/man/man1/
# Install OpenJDK-8
RUN apt-get update && \
apt-get install -y openjdk-8-jdk && \
apt-get install -y ant && \
apt-get clean;
# Fix certificate issues
RUN apt-get update && \
apt-get install ca-certificates-java && \
apt-get clean && \
update-ca-certificates -f;
# Setup JAVA_HOME -- useful for docker commandline
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/
After building and running the container,
i'm trying to connect like i did before instaling java :
docker exec -it docker-airflow_worker_1 /bin/bash
But i'm automaticaly disconnected. And java is installed
root#5475d28fb5f5:/usr/local/airflow# java -version
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (build 1.8.0_232-8u232-b09-1~deb9u1-b09)
OpenJDK 64-Bit Server VM (build 25.232-b09, mixed mode)
root#5475d28fb5f5:/usr/local/airflow# %
And when i log the container :
User information: uid=0 euid=0 gid=0 egid=0
[2019-10-31 12:07:40,312] {{settings.py:213}} INFO - settings.configure_orm(): Using pool settings. pool_size=5, max_overflow=10, pool_recycle=1800, pid=1
/usr/local/lib/python3.7/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
""")
[2019-10-31 12:07:40,621] {{__init__.py:51}} INFO - Using executor CeleryExecutor
Running a worker with superuser privileges when the
worker accepts messages serialized with pickle is a very bad idea!
If you really want to continue then you have to set the C_FORCE_ROOT
environment variable (but please think about this before you do).
User information: uid=0 euid=0 gid=0 egid=0
Can anyone help ?
Thanks
So you changed user to root in Dockerfile and Airflow now refuses to start. Try to move your new code in Dockerfile before USER airflow line. Also you can delete USER root line after that.
I currently have a docker container with an Ubuntu(17.10) image installed with other packages included. However, I'm currently having difficulty trying to install Java onto this container in addition to the current image.
Current Dockerfile :
FROM cityofzion/neo-privatenet
ADD files/ files/
ENTRYPOINT [ "/bin/bash" ]
When trying to find information on how to do this and testing inside of the container most suggest using this command: apt-get install -y oracle-java9-installer
However this results in:E: Unable to locate package oracle-java9-installer
I have also tried this suggested command wget http://download.java.net/java/GA/jdk9/9/binaries/jdk-9+181_linux-x64_bin.tar.gz
Which produces this result HTTP request sent, awaiting response...
404 Not Found - ERROR 404: Not Found.
I have only tried running these commands in the container, since that is how they would be run and they seem to be failing.
Can anyone suggest what I can include into my Dockerfile that install java onto my image?
Thanks in advance.
You can also directly pull any of the open-jdk images mentioned at (https://hub.docker.com/_/openjdk/) and use it. There is no need to install Ubuntu in docker image and then install Java on top of it. These images already use Ubuntu (with bare-minimum file system).
add to to your docker file
RUN \
apt-get update && \
apt-get install -y software-properties-common && \
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
add-apt-repository -y ppa:webupd8team/java && \
apt-get update && \
apt-get install -y oracle-java9-installer && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/oracle-jdk8-installer
ENV JAVA_HOME /usr/lib/jvm/java-9-oracle
Following from here
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
Oracle JDK version 7
sudo apt-get install oracle-java7-installer
Oracle JDK version 8
sudo apt-get install oracle-java8-installer