I have been trying to build a docker image for oracle/weblogic 12.2.1.
I followed all the instructions carefully as given in the official repo.
https://github.com/oracle/docker-images/tree/master/OracleWebLogic/dockerfiles/12.2.1.1
but when i run:
docker build -t oracle/weblogic:12.2.1.1-developer .
it gives me a permission denied error.
sudo docker build -t oracle/weblogic:12.2.1.1-developer .
Sending build context to Docker daemon 54.79MB
Step 1/13 : FROM oracle/serverjre:8
pull access denied for oracle/serverjre, repository does not exist or may require 'docker login'
can anyone please help me??
Thankyou
For some time now, it's needed not only to login with the Oracle account, but also to accept the license and user agreement. So you cannot do it only from command line. You must go to the Oracle container registry:
https://container-registry.oracle.com/
Then select Java repository, then select serverjre, then signin:
And accept the license:
Once you have done that, you'll be able to pull the docker image, but as other have said, you'll need to change the registry that is set inside the Dockerfile:
#FROM oracle/serverjre:8
FROM container-registry.oracle.com/java/serverjre:8
And afterwards, before running the build, you must do a docker login
docker login container-registry.oracle.com
username:<SSO USERNAME>
password:<SSO PASSWORD>
At this point, you'll be able to pull the image.
I followed the pattern used in the git hub project https://github.com/oracle/docker-images/tree/master/
If you checkout the project and go into the OracleJava directory and look at the *.download file (in this case for JRE 8: https://github.com/oracle/docker-images/blob/master/OracleJava/java-8/server-jre-8u151-linux-x64.tar.gz.download)
There is a link to download the tarball (after you accept the license agreement and sign in).
You can then place the tarball in the same directory as the build.sh (OracleJava/java-8).
Run: sh build.sh
This should then create the docker image of oracle/serverjre:8
You can should then be able to do your build and the instance of the image will be found locally.
If you're using a custom image with Dockerfile, Delete the oracle/ it's not your local repository.
Try docker build -t weblogic:12.2.1.1-developer .
Or just make a docker run [image]
I worked around the problem by having a docker image built for oracle/serverjre:8 in my machine.
I downloaded the oracle/Serverjre8 binaries and built a docker image then built the weblogic.And it worked !!
Alternately,you can pull the image for Oracle/ServerJre8 directly from Oracle container registry or Docker store by logging in first.
docker login container-registry.oracle.com
Username: <oracle sso="" username="">
Password: <oracle sso="" password="">
Login successful.
docker pull container-registry.oracle.com/java/serverjre:8
Considering WebLogic version 12.2.1.3, In case of PULL error and changing the registry to oracle registry, Below conditions should be checked-
While executing the script buildDockerImage.sh, make sure Dockerfile.developer (/docker-images/OracleWebLogic/dockerfiles/12.2.1.3/Dockerfile.developer) has entry to be changed-
#FROM oracle/serverjre:8
FROM container-registry.oracle.com/java/serverjre:8
User might need to be logged at oracle container registry for pull operation, so better is to login first prior to script execution.
docker login container-registry.oracle.com
username:<SSO USERNAME>
password:<SSO PASSWORD>
Also /docker-images/OracleWebLogic/dockerfiles/12.2.1.3/ contains fmw_12.2.1.3.0_wls_Disk1_1of1.zip.download file, that indicates necessary physical download of fmw_12.2.1.3.0_wls_Disk1_1of1.zip to be done from http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-for-dev-1703574.html and the same should be available at /docker-images/OracleWebLogic/dockerfiles/12.2.1.3/
Maybe when you created the Java image from OracleJava/8 you use the parameter version: 8-slim and with that image you try to create the weblogic image.
You just should use the version for default : Oracle Server JRE 8 on Oracle Linux 7 slim when create the OraclaJava image
build.sh for Oracle Java images
With that image of Java, you can create your weblogic image without problems, because that java image has tag: oracle/serverjre:8
echo "Building Oracle Server JRE 8 on Oracle Linux 7 slim"
docker build --tag oracle/serverjre:8 --tag oracle/serverjre:8-oraclelinux7 .
Related
I've been given a Docker image stored in the gitlab container registry, registry.gitlab.com.
I have a gitlab acount, with a password, and I am able to do a docker login:
docker login registry.gitlab.com
After I do that, I no longer get an authentication error when I try to do a docker command against that registry.
And the documentation for using that registry seems clear:
Go to your project or group’s Packages and registries > Container Registry and find the image you want.
Next to the image name, select Copy.
Use docker run with the image link:
docker run [options] registry.example.com/group/project/image [arguments]
https://docs.gitlab.com/ee/user/packages/container_registry/
But when I run any kind of docker command with the group/project/image I just copied, I just get the "manifest unknown" docker error, which normally indicates that the image is missing or mis-spelled.
So, maybe gitlab is broken, or maybe the gitlab documentation is wrong, or maybe there is something wrong with that particular image, or maybe it doesn't work using docker on WSL through Docker Desktop on Win10, or maybe ... I just haven't set up something correctly.
FWIW, Docker Desktop is a Windows service/application that proxies 'docker' commands in Windows, sending them to a docker instance running on WSL. It's normally transparent. It maintains a local registry, and seems to have some way of connecting to docker hub, but I've never used it with any other registry.
I'd like to pull that image into my local registry. What should I do different?
I am quite new to docker technology and still learning and reading through the docs. I have an oracle base image which i would like to use as a parent image to build my own image and then pushing it towards custom docker registry/repository.
The base image already provides a full setup of oracle db. But as next steps, i would like
download a dump file (e.g. dump url) directly into the docker image (without downloading to local
workspace)
run some sql script
lastly, import the dump using data pump (impdp)
I tried to follow https://github.com/mpern/oracle-docker, but here you always need to store dump file locally and point it as volume.
Is it possible if i can use curl command to download and directly store in oracle docker container workspace? Afterwards importing it from there
You can run an interactive bash session inside your container to check if curl is installed, and if it is not installed then you need to install Curl. Using an interactive bash session, you can then download your dump file.
The ports you require will also need to be be published, if the container is connecting outside of Docker and the host machine, you can use docker run with the -p parameter.
An example is below,
docker run -p 80:80 -it (Your image) /bin/bash
More information on this regarding the docker run command, and Dockerfiles
https://docs.docker.com/engine/reference/commandline/run/
https://docs.docker.com/engine/reference/builder/
I was following this post - the reference code is on GitHub. I have cloned the repository on my local.
The project has got a react app inside it. I'm trying to run it on my local following step 7 on the same post:
docker run -p 8080:80 shakyshane/cra-docker
This returns:
Unable to find image 'shakyshane/cra-docker:latest' locally
docker: Error response from daemon: pull access denied for shakyshane/cra-docker, repository does not exist or may require 'docker login'.
See 'docker run --help'.
I tried login to docker again but looks like since it belongs to #shakyShane I cannot access it.
I idiotically tried npm start too but it's not a simple react app running on node - it's in the container and containers are not controlled by npm
Looks like docker pull shakyshane/cra-docker:latest throws this:
Error response from daemon: pull access denied for shakyshane/cra-docker, repository does not exist or may require 'docker login'
So the question is how do I run this docker image on my local mac machine?
Well this is illogical but still sharing so future people like me don't get stuck.
The problem was that I was trying to run a docker image which doesn't exist.
I needed to build the image:
docker build . -t xameeramir/cra-docker
And then run it:
docker run -p 8080:80 xameeramir/cra-docker
In my case, my image had TAG specified with it and I was not using it.
REPOSITORY TAG IMAGE ID CREATED SIZE
testimage testtag 189b7354c60a 13 hours ago 88.3MB
Unable to find image 'testimage:latest' locally for this command docker run testimage
So specifying tag like this - docker run testimage:testtag worked for me
Posting my solution since non of the above worked.
Working on macbook M1 pro.
The issue I had is that the image was built as arm/64. And I was running the command:
docker run --platform=linux/amd64 ...
So I had to build the image for amd/64 platform in order to run it.
Command below:
docker buildx build --platform=linux/amd64 ...
In conclusion your docker image platform and docker run platform needs to be the same from what I experienced.
In my case, the docker image did exist on the system and still I couldn't run the container locally, so I used the exact image ID instead of image name and tag, like this:
docker run myContainer c29150c8588e
I received this error message when I typed the name/character wrong. That is, "name1\name2" instead of "name1/name2" (wrong slash).
In my case, I saw this error when I had logged in to the dockerhub in my docker desktop. The repo I was pulling was local to my enterprise. Once i logged out of dockerhub, the pull worked.
This just happened to me because my local docker vm on macos ran out of disk space.
I just deleted some old images using docker image prune and it started working correctly again.
shakyshane/cra-docker Does not exist in that user's repo https://hub.docker.com/u/shakyshane/
The problem is you are trying to run an imagen that does not exists. If you are executing a Dockerfile, the image was not created until Dockerfile pass with no errors; so when Dockerfile tries to run the image, it can't find it. Be sure you have no errors in the execution of your scripts.
The simplest answer can be the correct one!.. make sure you have permissions to execute the command, use:
sudo docker run -p 8080:80 shakyshane/cra-docker
In my case, I didn't realise there was a difference between docker run and docker start, and I kept using the run command when I should've been using the start command.
FYI, run is for building and creating the docker container, start is to just start a stopped container
Use -d
sudo docker run -d -p 8000:8000 rasa/duckling
learn about -d here
sudo docker run --help
At first, i build image on mac-m1-pro with this command docker build -t hello_k8s_world:0.0.1 ., when is run this image the issue appear.
After read Master Yi's answer, i realize the crux of the matter and rebuild my images like this docker build --platform=arm64 -t hello_k8s_world:0.0.1 .
Finally,it worked.
I'm trying to implement docker with jenkins and am not sure if I am on the right track.
Given:
Running jenkins on docker from Windows
Plan on fetching code from github, building the solution, running functional tests, etc on a container somehow
What I've currently done:
(1) Installed Docker on Windows
(2) Successfully launched Jenkins on Docker with the command
"docker run –name myJenkins -p 8080:8080 -p 50000:50000 -v ~/Jenkins:/var/jenkins_home/ jenkins/jenkins:lts"
I believe this step binds the docker volume to my host machine's directory. This allows me to view and access the Jenkins content.
(3) In my host machine's Jenkins directory, I've created a plugin.txt (containing a variety of Jenkins plugins I want installed) and a Dockerfile. The Dockerfile installs the specified plugins in the plugins.txt file.
FROM jenkins/jenkins:lts
COPY plugins.txt /usr/share/jenkins/ref/plugins.txt
RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt
(4) In the windows command prompt, I built the Dockerfile with the command "docker build -t new_jenkins_image ."
(5) I stop my current container "myJenkins" and create a new container with the command "docker run –name myJenkins2 -p 8080:8080 -p 50000:50000 -v ~/Jenkins:/var/jenkins_home/ new_jenkins_image". This loads up Jenkins with the newly installed jenkins plugins.
What I'm stuck/confused on
(1) Do I have to create a new container with a new name every time I want to install new jenkins plugins through the Dockerfile? This seems like a manual process as well... There has to be a better way.
(2) I started a basic jenkins pipeline job with the "Pipeline script from SCM" option. I entered in the correct repository URL and credentials but left the "Script Path" blank for now (I do not have a Jenkinsfile yet). When I execute the build, Jenkins did not fetch the code from github.
java.lang.IllegalArgumentException: Empty path not permitted.
at org.eclipse.jgit.treewalk.filter.PathFilter.create(PathFilter.java:80)
at org.eclipse.jgit.treewalk.TreeWalk.forPath(TreeWalk.java:205)
at org.eclipse.jgit.treewalk.TreeWalk.forPath(TreeWalk.java:249)
at org.eclipse.jgit.treewalk.TreeWalk.forPath(TreeWalk.java:281)
at jenkins.plugins.git.GitSCMFile$3.invoke(GitSCMFile.java:171)
at jenkins.plugins.git.GitSCMFile$3.invoke(GitSCMFile.java:165)
at jenkins.plugins.git.GitSCMFileSystem$3.invoke(GitSCMFileSystem.java:193)
at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:72)
at jenkins.plugins.git.GitSCMFileSystem.invoke(GitSCMFileSystem.java:189)
at jenkins.plugins.git.GitSCMFile.content(GitSCMFile.java:165)
at jenkins.scm.api.SCMFile.contentAsString(SCMFile.java:338)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:110)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:293)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE
I believe it's because the docker container does not have git installed? The container cannot access the Git or MSBuild from my host machine... Do I have to create a new container here to simply fetch the code?
Can someone explain to me what I'm missing or where I went wrong?
From my understanding, the process goes like this: Create new pipeline job -> select pipeline script from scm -> enter repo URL, credentials, branch to build and Jenkinsfile -> Jenkinsfile will execute instructions to compile, test, and deploy.
Where does the Dockerfile come into play here? Is my thought process on the right track?
you need to create container every time if you change/update the image. but it not required to give a new name each time. Did you stopped and removed previously running container? if not so docker gives errors like same name container cannot start. So stop and remove your previous container. and you will be able to start a new container with an updated image.
Yes, you need to install git in the same container to pull the code. it cannot access git on the host machine. But the error you are showing is like validation error. (i mean Jenkins validates input even before trying to pull the code. if you add some fake name it will throw next error like git not found)
Your thought is on correct track. Create new pipeline job -> select pipeline script from scm -> enter repo URL, credentials, branch to build and Jenkinsfile -> Jenkinsfile will execute instructions to compile, test, and deploy.
At the end of the question, you mentioned about different Dockerfile, i assume you are talking about Dockerfile in your repository (git). you can run your pipeline in docker agent. This removes to setup everything on jenkins host means you dont need to install dependencies to run your pipeline code on host, for example, if you are trying to execute some nodejs code in pipe, you need to setup nodejs on Jenkins host before you run the pipe, to get rid of this you can run pipe in container where everything is pre-setup. But I don't think you can use this feature if you are running Jenkins itself in docker. you need to setup Jenkins on the host directly in that case.
I have installed docker in a system which has no connection to Internet so to run an image with docker, I had to download a simple image from this and from another system. Then I put this image in my offline system in this path : C:\Users\Public\Documents\Hyper-V\Virtual hard disks
but when I run docker run hello-world in cmd I see this message:
Unable to find image 'hello-world:latest' locally
and tries to download hello-world image form Internet but it has to no connection to the Internet so it field. Now I want to know where I should put my images in to be visible to docker?
You can do it the easy way without messing around with folders, by exporting the docker image from any other machine with access to internet:
pull the image on a machine with internet access.
$docker pull hello-world
save that image to a .tar file.
$ docker save --output hello-world.tar {your image name or ID}
copy that file to any machine.
load the .tar file to docker.
$docker load --input hello-world.tar
Check out:
https://docs.docker.com/engine/reference/commandline/image_save/
https://docs.docker.com/engine/reference/commandline/load/#examples
You are trying to start a container using the dockerfile. You need to first build the image from dockerfile. You can do this via
docker build -t < image name > < path >
You will require the internet connection while building the image.
You can check the image in your system using
docker images
Once you build the docker image you can start the container without internet connection using
docker run < image name >
Also you can export the same image using docker save and docker load functionalities.
Docker runs in a client-server architecture environment just almost like git. It can pull resources from the server online with the client on "your machine".
The command $docker pull hello-world requires connection to the server as part of docker itself.