1

I want to upload my images folder directly to my OpenShift server rather than keeping the images in my source code file.

I also have few jars which are related to the company. How do I install those to OpenShift 3 server's m2 Maven repository?

Reference
=========
1)mounted saperately as per your clarification-
/dev/xvdbe     999320    4424    926084   1% /imgs
2)I have done the Recreate
3)I verified oc rsh
sh-4.2$ cd /imgs                                                                                                                                                    
sh-4.2$ ls                                                                                                                                                          
images-static  lost+found                                                                                                                                           
sh-4.2$ cd images-static                                                                                                                                            
sh-4.2$ ls                                                                                                                                                          
beads  gemstones  hooks  jcarousel  necklace  necklaces  pendants                                                                                                   
sh-4.2$ cd necklaces                                                                                                                                                
sh-4.2$ ls                                                                                                                                                          
1497330344375_.jpg    
1497330365931.jpg                                         
1497330357394.jpg  
premadeDesigns 
modifiableDesigns 
4)I am accessing my images with URL 
http://openshiftLink.com/imgs/images-static/necklaces/                                                                                  /   1497330344375.jpg 
is this the right way to access persistence volumes   
Karthik
  • 39
  • 5
  • 2
    To those marking this issue to be closed because it isn't clear what is being asked, it is actually obvious if you know anything about OpenShift. Please don't mark issues to be closed when it isn't an area you know anything about. – Graham Dumpleton Dec 14 '17 at 10:00

1 Answers1

0

If you have a persistent volume attached to your container which application uses, you can use oc rsync to copy files such as images to the persistent volume.

Another option is to use a binary input build rather than pulling source code from a Git repository. That way it is easier to push up with a build files which are not part of a Git repository. This could be images or could also be pre-compiled binary artifacts.

Details on binary input builds can be found at:

Graham Dumpleton
  • 57,726
  • 6
  • 119
  • 134
  • Hii @Graham Dumpleton. I am new to openshift and hosting a Java application. May be these are silly doubts and little annoying for you. Even though you are responding as much as you can. Thanks for your patience and response. – Karthik Dec 14 '17 at 12:07
  • Hii @Graham Dumbleton. I have claimed a 1Gi storage in persistence volume volume name is "pictures-storage". I added this storage in my application the mount name is "/imgs" i am not able to access this path by using "/imgs" in my application. How to access it can you please help. – Karthik Dec 16 '17 at 10:26
  • If you have done it correctly, there is no reason you shouldn't be able to. Have you used ``oc rsh`` to get into the container and verified that ``/imgs`` directory exists? Have you from in that directory run ``df -k .`` to see that it is a separate mount? Have you changed your deployment strategy to ``Recreate`` instead of ``Rolling`` as you can only use a persistent volume in OpenShift Online with ``Recreate`` deployment strategy. – Graham Dumpleton Dec 16 '17 at 10:38
  • Hii @Graham Dumbleton i have added reference outputs in the question please see it but still not able to access – Karthik Dec 16 '17 at 11:29
  • Just because you mount a persistent volume as a directory doesn't mean you can then access it using a URL of ``http://openshiftLink.com/imgs/images-static/necklaces/ ``. You need to modify your application, or if a web server, configure it, to map requests against a specific sub URL to the directory. Have you done that? What image or S2I builder are you using? – Graham Dumpleton Dec 16 '17 at 19:47
  • Hii @Graham Dumbleton. I added claimed persistence volume in my application pod. As you said "You need to modify your application, or if a web server, configure it, to map requests against a specific sub URL to the directory"--> how to do this could you tell me the steps. – Karthik Dec 18 '17 at 07:15
  • I can't help you with that as I know zero about your application and also nothing about doing it for Java apps in general, presuming that is what you are using based on mentions of jar files and maven. You should search documentation for your application stack as to how to host static files. – Graham Dumpleton Dec 18 '17 at 07:21
  • Hii @Graham Dumpleton. I think i need to map "/imgs" in server.xml. Can you tell me how can i access & modify Tomcat's server.xml file in openshift3. – Karthik Dec 18 '17 at 13:12