Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"oel7:7-slim as OS_UPDATE" is not a valid repository/tag: invalid reference format #71

Closed
GerthH opened this issue Aug 30, 2019 · 7 comments

Comments

@GerthH
Copy link

GerthH commented Aug 30, 2019

How do I prevent imagetools's "invalid reference format" ?

$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
oel7 7-slim 874477adb545 3 weeks ago 118 MB
oel7 slim 874477adb545 3 weeks ago 118 MB
oel7 latest 5f993b1aafe5 3 weeks ago 235 MB

$ imagetool cache listItems
Cache contents
cache.dir=/u01/oracledocker/wlsimg_cachedir
jdk_8u221=/u01/oracledocker/stage/jdk-8u221-linux-x64.tar.gz
wls_12.2.1.3.0=/u01/stage/fmw_12.2.1.3.0_infrastructure.jar
wdt_1.3.0=/u01/oracledocker/stage/weblogic-deploy-1-3-0.zip

]$ docker version
Client:
Version: 1.13.1
API version: 1.26
Package version: docker-1.13.1-96.gitb2f74b2.el7.x86_64
Go version: go1.10.8
Git commit: b2f74b2/1.13.1
Built: Tue Apr 2 21:01:07 2019
OS/Arch: linux/amd64

Server:
Version: 1.13.1
API version: 1.26 (minimum version 1.12)
Package version: docker-1.13.1-96.gitb2f74b2.el7.x86_64
Go version: go1.10.8
Git commit: b2f74b2/1.13.1
Built: Tue Apr 2 21:01:07 2019
OS/Arch: linux/amd64
Experimental: false

$ imagetool create --fromImage=oel7:7-slim --jdkVersion=8u221 --tag=wls:12.2.1.3.0 --version=12.2.1.3.0
[INFO ] Temporary directory used for docker build context: /u01/oracledocker/build/wlsimgbuilder_temp4698535419410021917
[INFO ] docker cmd = docker build --force-rm=true --no-cache --tag wls:12.2.1.3.0 --build-arg WLS_PKG=fmw_12.2.1.3.0_infrastructure.jar --build-arg JAVA_PKG=jdk-8u221-linux-x64.tar.gz /u01/oracledocker/build/wlsimgbuilder_temp4698535419410021917
Sending build context to Docker daemon 1.823 GB

Step 1/35 : FROM oel7:7-slim as OS_UPDATE
[SEVERE ] Response code: -1, message: docker command failed with error: Error parsing reference: "oel7:7-slim as OS_UPDATE" is not a valid repository/tag: invalid reference format

@ddsharpe
Copy link
Member

I haven't seen this issue before. I tagged an OEL image locally with the same name on my machine but don't get any errors.

For example:
[laptop]:bin $ docker tag oraclelinux:7-slim oel7:7-slim
[laptop]:bin $ imagetool create --tag derek:2 --fromImage oel7:7-slim
[INFO ] Temporary directory used for docker build context: /Users/xxxx/wlsimgbuilder_temp1134269872710003830
[INFO ] docker cmd = docker build --force-rm=true --no-cache --tag derek:2 --build-arg WLS_PKG=fmw_12.2.1.3.0_wls_Disk1_1of1.zip --build-arg JAVA_PKG=jdk-8u202-linux-x64.tar.gz /Users/xxxx/wlsimgbuilder_temp1134269872710003830
Sending build context to Docker daemon 1.033GB

Step 1/35 : FROM oel7:7-slim as OS_UPDATE
---> 90e39322df71

My only guess is that the docker version you are running has a bug or doesn't support something in this Dockerfile.

My docker client version is 19.03.1 on Mac, and 18.09.7 on Linux. Your version is 1.x which seems way off.

@GerthH
Copy link
Author

GerthH commented Aug 30, 2019

Well I also run a successful build on 19.03.1 on Mac see previous issue that I reported.
This error message appear when I moved to RedHat EL7 with Docker version docker-1.13.1-96 which is the packaged version distributed with RHEL7.

I will see if I can get RedHat Docker CE or RedHat Docker EE installed to try to solve this error which is reported in many cases to "attempting to try to build a multi layered image" in a docker version that does not support it.

@ddsharpe
Copy link
Member

You can run with the command line option "--cleanup false" to save the Docker build folder for image tool. The tmp directory that the tool creates with the installers, Dockerfile, etc. will not be deleted at the end of the run. Then, you can go to the wlsimgbuilder_tempXXXX folder and view the Dockerfile or even rerun the docker build command manually. Once you see the message "Sending build context to Docker daemon", imagetool has initiated the Docker build command and everything except for cleanup is running inside of Docker.

@GerthH
Copy link
Author

GerthH commented Aug 31, 2019

I believe I have found the cause for the error.

Similar error reported:
spotify/docker-maven-plugin#264
Also note that multistage builds (FROM xxx as yyy) are supported from Docker 17.05 onwards.

Docker docs:
https://docs.docker.com/develop/develop-images/multistage-build/
Multi-stage builds are a new feature requiring Docker 17.05 or higher on the daemon and client.

Imagetool uses multistage builds here:
Create_Image.mustache
...
FROM {{baseImage}} as OS_UPDATE
...
FROM OS_UPDATE as WLS_BUILD
...

So it seems that I need to upgrade to a RHEL7 docker version that is the equivalent of higher than Docker 17.05.

@GerthH GerthH closed this as completed Aug 31, 2019
@GerthH
Copy link
Author

GerthH commented Aug 31, 2019

Would it be possible to add functionality to have Imagetool to work with out multistage docker builds in order to support RHEL7 docker-1.13.1-96 ?

Ie a second Create_Image.mustache file that does not use multistage builds and have a command line option to choose between them and keep the current multistage build as the default.

@GerthH GerthH reopened this Aug 31, 2019
@ddsharpe
Copy link
Member

ddsharpe commented Sep 2, 2019

While it would be possible to support older Docker versions, the demand for this feature would need to be significantly higher before it would be worth the added support cost. Writing the new mustache template would be relatively easy, but the cost of extra testing and keeping the templates in sync is not justified at this time.

@GerthH
Copy link
Author

GerthH commented Sep 3, 2019

Unable to find functionality matrix showing RHEL7 docker-1.13.1-96 and the Docker CE / EE version (YY-MM) for comparison.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants