[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Running sshd in a Docker Container on Openshift



Anther ad-hoc way of moving data between pods is possible if you have 'netcat' tools installed in image for each application.

Look at the example in:

    http://www.microhowto.info/howto/copy_a_file_from_one_machine_to_another_using_netcat.html

The idea though is that on source pod you run:

    tar zc *.txt | nc -l 60000

and on target pod you pull them using:

    nc pod-name 60000 | tar zx

Replace 'pod-name' with actual pod name. The pod-name is mapped in internal DNS so you don't have to worry about what the IP address is.

Graham

On 10 Jul 2017, at 7:43 AM, Graham Dumpleton <gdumplet redhat com> wrote:

If your applications are in the same project, you may find it easier to mount an extra persistent volume temporarily in the source pod. Access the pod using 'oc rsh' and copy the files into that persistent volume and then detach it from that pod. Then mount the persistent volume into the target pod and use as is, or copy into the target pod persistent volume and then detach and delete the temporary persistent volume.

We recently published a scenario in our interactive learning portal for OpenShift about transferring files in and out of an application. We didn't specifically cover moving files between pods, but mounting pods against a temporary application to pre-load data into a persistent volume was covered. What I suggest as a bit of a variation on that.

You can see the scenario at:


It was called:

    Transferring Files in and out of Containers

Graham

On 10 Jul 2017, at 12:10 AM, Isuru Haththotuwa <isurulucky gmail com> wrote:

Hi Marko,

On Sun, Jul 9, 2017 at 4:29 PM, Marko Lukša <marko luksa gmail com> wrote:
There's no need to run sshd. Use oc rsh or oc exec.
Thanks for the reply. However, I am trying to run a rsync pull from a different pod to this particular pod, that is the reason why I'm trying to run sshd. Would this be possible with rsh? 

On Jul 9, 2017 12:02 PM, "Isuru Haththotuwa" <isurulucky gmail com> wrote:
Hi,

I'm trying to do $subject. Using the minimal docker sample found at [1]. While this works perfectly in bare docker, when I'm trying to run on Openshift it fails with the error [2]. When I tried to re-create the ssh keys at startup with ssh-keygen -A, gave me the error [3]. I read that Openshift uses a random user id (usually 1000000000) when starting a container, I created a user with the same id, gave permission to /etc/ssh/ssh* and ran. Still did not work.

Seems a permission issue. Any idea what is going wrong here?

[1]. https://docs.docker.com/engine/examples/running_ssh_service/#build-an-eg_sshd-image

[2].
Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Could not load host key: /etc/ssh/ssh_host_ed25519_key

[3].
open /etc/ssh/ssh_host_key failed: Permission denied.
ssh-keygen: generating new host keys: RSA1 Saving the key failed: /etc/ssh/ssh_host_key.
ssh-keygen: generating new host keys: RSA Saving the key failed: /etc/ssh/ssh_host_rsa_key.
open /etc/ssh/ssh_host_rsa_key failed: Permission denied.
open /etc/ssh/ssh_host_dsa_key failed: Permission denied.
ssh-keygen: generating new host keys: DSA Saving the key failed: /etc/ssh/ssh_host_dsa_key.
open /etc/ssh/ssh_host_ecdsa_key failed: Permission denied.
ssh-keygen: generating new host keys: ECDSA Saving the key failed: /etc/ssh/ssh_host_ecdsa_key.
open /etc/ssh/ssh_host_ed25519_key failed: Permission denied.
ssh-keygen: generating new host keys: ED25519 Saving the key failed: /etc/ssh/ssh_host_ed25519_key.

--
Thanks and Regards,
Isuru

_______________________________________________
users mailing list
users lists openshift redhat com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users




--
Thanks and Regards,
Isuru
_______________________________________________
users mailing list
users lists openshift redhat com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]