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

S2I image build with custom GV provider fails #253

Closed
vsirimalla opened this issue Jan 3, 2022 · 14 comments
Closed

S2I image build with custom GV provider fails #253

vsirimalla opened this issue Jan 3, 2022 · 14 comments

Comments

@vsirimalla
Copy link

Version Information

Software Version(s)
BusinessEvents 6.2
OS Type? RHEL
OS Version? 7.8
Docker 1.13 (RedHat)
Kubernetes
Helm

What is the expected behavior?

$ ./build_image.sh -i s2ibuilder -s ~/installers/ -t tibco-be:6.2 --gv-provider ge-consul -d dockerfiles/Dockerfile-s2i
running above command should be able to build a BE source image, but it fails that lstat isn't available.

What is the actual behavior?

$ ./build_image.sh -i s2ibuilder -s ~/installers/ -t tibco-be:6.2 --gv-provider ge-consul -d dockerfiles/Dockerfile-s2i
running above command should be able to build a BE source image, but it fails that lstat isn't available.

Please provide a unit test that demonstrates the bug.

Other notes on how to reproduce the issue?

Please provide log files.

Any possible solutions?

Documentation did not specify which Dockerfile to be used for s2i build image with just softwares (not an application image)

Can you identify the location in the source code where the problem exists?

If the bug is confirmed, would you be willing to submit a PR?

Yes / No (Help can be provided if you need assistance submitting a PR)

@nareshkumarthota
Copy link
Collaborator

can you try running same build command without giving -d option. Building source image uses this ./dockerfiles/Dockerfile file. And it is picked up automatically. If you like to use your own docker file you can use -d option by pointing to customised docker file.

@vsirimalla
Copy link
Author

can you try running same build command without giving -d option. Building source image uses this ./dockerfiles/Dockerfile file. And it is picked up automatically. If you like to use your own docker file you can use -d option by pointing to customised docker file.

I tried as you suggested, this is what I am seeing now.

Removing intermediate container 6ccc2769057e
The command '/bin/sh -c apt-get update  && apt-get install -y unzip procps findutils tar' returned a non-zero code: 100
ERROR: Container build failed.
unknown shorthand flag: 'f' in -f

@nareshkumarthota
Copy link
Collaborator

Are you using rhel os to build this image?

@vsirimalla
Copy link
Author

I am using FROM docker.io/library/ubuntu:20.10 as the base image, which I had to update in the Dockerfile
Host that I am running these commands is running RHEL 7.8

@rameshpolishetti
Copy link
Collaborator

@vsirimalla As per Ubuntu releases https://wiki.ubuntu.com/Releases Ubuntu 20.10 (Groovy Gorilla) has already past End Of Life (EOL) July 22, 2021
Updating the the version to one of the Long Term Support (LTS) releases (like: 20.04) should fix the issue.

Note: be-tools master branch is using ubuntu LTS version 20.04. Please take latest.

@vsirimalla
Copy link
Author

vsirimalla commented Jan 3, 2022

Thanks @rameshpolishetti

I just took the latest dockerfiles/Dockerfile content from GIT and rerun the job as is, and it is failing at the first step.

Step 1/70 : ARG BE_PRODUCT_VERSION
Please provide a source image with `from` prior to commit
ERROR: Container build failed.
unknown shorthand flag: 'f' in -f

So then, I did add the FROM docker.io/library/ubuntu:20.04 statement at the beginning of the file to make it work. With that step, it has advanced to next build steps, but eventually failed at another step with similar error message.

Step 15/71 : FROM docker.io/library/ubuntu:20.04 as intermediate
Error parsing reference: "docker.io/library/ubuntu:20.04 as intermediate" is not a valid repository/tag: invalid reference format
ERROR: Container build failed.
unknown shorthand flag: 'f' in -f

If I remove as intermediate part from that FROM statement, then it has successfully ran upto step 62 , but then eventually failed with below message.

Step 62/71 : COPY --from=intermediate /home/tibco/be /home/tibco/be
Unknown flag: from
ERROR: Container build failed.
unknown shorthand flag: 'f' in -f
See 'docker --help'.

I wonder if the RHEL Docker does recognize multi stage builds (like above)? Please advise.

$docker --version
Docker version 1.13.1, build 7d71120/1.13.1

$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.9 (Maipo)

@rameshpolishetti
Copy link
Collaborator

@vsirimalla looks like you are trying to build BE app image on a RHEL machine. be-tools scripts are tuned to work on Linux (Ubuntu), Mac & Windows host machines. If you trying on difference machine then you may need to adapt scripts little bit as per the host OS shell syntax.

@rameshpolishetti
Copy link
Collaborator

@vsirimalla Regarding multi-stage build support - I see from Docker release notes https://docs.docker.com/engine/release-notes/17.05/#builder that multi-stage build support is added from the version 17.05
Since you are using Docker version 1.13.1 multi-stage build wont work.

Since you are using RHEL, you can consider is using buildah tool as an alternative to Docker. be-tools scripts can also be used with buildah. You need to use the option -b while building the BE app image.
Example: ./build_image.sh -b buildah ...
For documentation, please refer to: https://github.com/TIBCOSoftware/be-tools/wiki/Building-TIBCO-BusinessEvents#build-script

Useful links:
https://github.com/containers/buildah/blob/main/install.md
https://developers.redhat.com/blog/2021/01/11/getting-started-with-buildah#

@vsirimalla
Copy link
Author

RHEL Docker is a different from upstream Docker.
RHEL Docker 1.13 is the latest I could see from Yum repo.

Let me try with buildad instead
I will update here.

@vsirimalla
Copy link
Author

@rameshpolishetti
ERROR: s2ibuilder image is not supported with buildah tool.

Looks like buildah does not work with s2ibuilder option.

@nareshkumarthota
Copy link
Collaborator

@vsirimalla There is no support for s2i with buildah. You can check there is one open ticket in s2i repo here.
Script provided here will use intermediate images. If you try to alter the scripts behaviour may be differed.

One more observation, from s2i docs I see that docker version should be 1.6 and higher. Check it here.

@vsirimalla
Copy link
Author

vsirimalla commented Jan 4, 2022

@rameshpolishetti
I created a local VM in my PC (spun up with Virtual Box) with ubuntu OS and ran the commands. Please find the attached file.
its failing with an error.
be image creation error.txt

@nareshkumarthota
Copy link
Collaborator

@vsirimalla In your VM try running docker without sudo privilege. You can find post installation steps for docker here. Once you are able to run your docker try running build script without sudo.

@rameshpolishetti
Copy link
Collaborator

Hi @vsirimalla I believe now you are able to build BE application container image. Please confirm and close the issue.

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

3 participants