2016-09-09 16:13 GMT-03:00 Skarbek, John <[email protected]>:

> Robson,
>
> What is it that you are trying to accomplish? In your prior thread you
> mention the use of setting up an ftp docker image. I think there’s a
> misunderstanding for the purpose of s2i here.
>
You are right. I'm sorry for the confusion here. To simplify, I just need
to set a custom hostname during a build of the image (if it is possible).

> s2i build is not going to build the Dockerfile that you posted. s2i is
> meant to take an existing docker image that is already built, and create a
> runnable application. It’s a builder for an application container.
>
I see. I did know about that. Thank you


>
> --
> John Skarbek
>
> On September 9, 2016 at 12:58:27, Robson Ramos Barreto (
> [email protected]) wrote:
>
> Sure,
>
> I'm trying create an image with ssh because I think that sshd is more easy
> to test
>
> Follow the code so far:
>
> # cat Dockerfile
>
> # ose-ftp-rhel7
> FROM rhel7.2
>
> ENV BUILDER_VERSION 1.0
> ENV HOSTNAME ose-ftp.example.com
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__ose-2Dftp.example.com&d=DQMFaQ&c=_hRq4mqlUmqpqlyQ5hkoDXIVh6I6pxfkkNxQuL0p-Z0&r=8IlWeJZqFtf8Tvx1PDV9NsLfM_M0oNfzEXXNp-tpx74&m=_iU9xf0GzcebBNDBdsmcTnQ0IrzCflnn8SAyRzqeiew&s=jsORd7D-3eZfNWDiEIvWO11SpaHlcosNvoIWtQKzxwY&e=>
>
> RUN INSTALL_PKGS="openssh-server ipa-client" && KADMIN_PASS="" &&
> HOSTNAME="ose-ftp.example.com
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__ose-2Dftp.example.com&d=DQMFaQ&c=_hRq4mqlUmqpqlyQ5hkoDXIVh6I6pxfkkNxQuL0p-Z0&r=8IlWeJZqFtf8Tvx1PDV9NsLfM_M0oNfzEXXNp-tpx74&m=_iU9xf0GzcebBNDBdsmcTnQ0IrzCflnn8SAyRzqeiew&s=jsORd7D-3eZfNWDiEIvWO11SpaHlcosNvoIWtQKzxwY&e=>"
> && \
>     yum install -y $INSTALL_PKGS && yum clean all -y
>     #ipa-client-install --server=ipaserver.example.com
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__ipaserver.example.com&d=DQMFaQ&c=_hRq4mqlUmqpqlyQ5hkoDXIVh6I6pxfkkNxQuL0p-Z0&r=8IlWeJZqFtf8Tvx1PDV9NsLfM_M0oNfzEXXNp-tpx74&m=_iU9xf0GzcebBNDBdsmcTnQ0IrzCflnn8SAyRzqeiew&s=czDfQMTpFvRptgN-fgaXkEcZtbiwfV2fifOzM6K7Mtc&e=>
> --password=$KADMIN_PASS --mkhomedir --domain=example.com
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__example.com&d=DQMFaQ&c=_hRq4mqlUmqpqlyQ5hkoDXIVh6I6pxfkkNxQuL0p-Z0&r=8IlWeJZqFtf8Tvx1PDV9NsLfM_M0oNfzEXXNp-tpx74&m=_iU9xf0GzcebBNDBdsmcTnQ0IrzCflnn8SAyRzqeiew&s=02M2gQiFYZxUuTtJ5s3thdw1ll2DWCFMoWlg1G4ILxA&e=>
> --unattended
>
> LABEL io.openshift.s2i.scripts-url=image:///usr/local/s2i
>
> COPY ./.s2i/bin/ /usr/local/s2i
>
> USER root
>
> EXPOSE 22
>
> CMD ["/usr/sbin/sshd", "-D"]
>
>
> # cat .s2i/bin/run
> exec /usr/sbin/sshd -D
>
> # make
> # docker run -d -P ose-ftp-rhel7-candidate
>
> and so I have the image with the ssh service working but no hostname
> changed
>
> Perhaps should I put the set hostname in the .s2i/bin/run
>
> ---
>
> Another thing that I'm figuring out is when I run:
>
> # s2i build . rhel7 ose-ftp --loglevel=3
>
> This isn't running the RUN section from dockerfile to install the
> packages, only if I run the: # make command that it have effect.
>
> Is it normal ?
>
> From s2i build command I'm not getting any error
>
> Thank you
>
>
>
> 2016-09-09 12:28 GMT-03:00 Jonathan Yu <[email protected]>:
>
>> Hey Robson,
>>
>> I see, thanks for the context. I'm unfamiliar with ipa-client, so will
>> just share two thoughts:
>>
>> 1. The hostname is fixed for the lifetime of the container (that is, once
>> the pod starts, it will keep its hostname until it crashes or is stopped)
>> 2. If you want to choose a hostname, consider using the PetSet feature:
>> http://kubernetes.io/docs/user-guide/petset/
>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__kubernetes.io_docs_user-2Dguide_petset_&d=DQMFaQ&c=_hRq4mqlUmqpqlyQ5hkoDXIVh6I6pxfkkNxQuL0p-Z0&r=8IlWeJZqFtf8Tvx1PDV9NsLfM_M0oNfzEXXNp-tpx74&m=_iU9xf0GzcebBNDBdsmcTnQ0IrzCflnn8SAyRzqeiew&s=5j2Lh5b188xg8qB1QTJ2ZUinb-m3BfW79xZPQeGD0GI&e=>
>> - this requires OpenShift Origin 1.3, or the yet-to-be-released OpenShift
>> Container Platform 3.3
>>
>> However, I'm unsure how this relates to s2i. Would it be possible for you
>> to share any code or working example that you have put together so far?
>>
>> On Fri, Sep 9, 2016 at 7:35 AM, Robson Ramos Barreto <
>> [email protected]> wrote:
>>
>>> Hello Jonathan
>>>
>>> Thank you for your time.
>>>
>>> I'm trying to install the ipa-client on which must have a fixed hostname
>>>
>>> My final goal is set up a FTP container with centralized authentication
>>> as I asked for advice:
>>>
>>> http://lists.openshift.redhat.com/openshift-archives/users/2
>>> 016-September/msg00026.html
>>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.openshift.redhat.com_openshift-2Darchives_users_2016-2DSeptember_msg00026.html&d=DQMFaQ&c=_hRq4mqlUmqpqlyQ5hkoDXIVh6I6pxfkkNxQuL0p-Z0&r=8IlWeJZqFtf8Tvx1PDV9NsLfM_M0oNfzEXXNp-tpx74&m=_iU9xf0GzcebBNDBdsmcTnQ0IrzCflnn8SAyRzqeiew&s=_8bI8x2tzxFAGtwUBm9YAAQqbwYVB32dydiZ3epRtJA&e=>
>>>
>>> Thank you
>>>
>>> 2016-09-08 17:36 GMT-03:00 Jonathan Yu <[email protected]>:
>>>
>>>> Hey Robson,
>>>>
>>>> Can you elaborate more on what you're trying to do and why you need to
>>>> change the hostname?
>>>>
>>>> I'm no expert, but I believe changing the hostname requires root, and
>>>> s2i builds typically run as a nonprivileged user, so it's likely not
>>>> possible to change the hostname from within the build at build time.
>>>>
>>>> On Thu, Sep 8, 2016 at 1:28 PM, Robson Ramos Barreto <
>>>> [email protected]> wrote:
>>>>
>>>>> Hello Guys,
>>>>>
>>>>> Is there any way to set hostname when building a s2i ?
>>>>>
>>>>> Thank you
>>>>>
>>>>> _______________________________________________
>>>>> users mailing list
>>>>> [email protected]
>>>>> http://lists.openshift.redhat.com/openshiftmm/listinfo/users
>>>>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.openshift.redhat.com_openshiftmm_listinfo_users&d=DQMFaQ&c=_hRq4mqlUmqpqlyQ5hkoDXIVh6I6pxfkkNxQuL0p-Z0&r=8IlWeJZqFtf8Tvx1PDV9NsLfM_M0oNfzEXXNp-tpx74&m=_iU9xf0GzcebBNDBdsmcTnQ0IrzCflnn8SAyRzqeiew&s=r4qjtqGXHC8vpZNMal9MgaQVOQ1o_FNDBQAVZ-T8guk&e=>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Jonathan Yu, P.Eng. / Software Engineer, OpenShift by Red Hat / Twitter
>>>> (@jawnsy) is the quickest way to my heart
>>>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__twitter.com_jawnsy&d=DQMFaQ&c=_hRq4mqlUmqpqlyQ5hkoDXIVh6I6pxfkkNxQuL0p-Z0&r=8IlWeJZqFtf8Tvx1PDV9NsLfM_M0oNfzEXXNp-tpx74&m=_iU9xf0GzcebBNDBdsmcTnQ0IrzCflnn8SAyRzqeiew&s=hVfGgNVeNnYk2AfZYVyRp0hhdQcC_4JTtRnPnAsGILA&e=>
>>>>
>>>> *“A master in the art of living draws no sharp distinction between his
>>>> work and his play; his labor and his leisure; his mind and his body; his
>>>> education and his recreation. He hardly knows which is which. He simply
>>>> pursues his vision of excellence through whatever he is doing, and leaves
>>>> others to determine whether he is working or playing. To himself, he always
>>>> appears to be doing both.”* — L. P. Jacks, Education through
>>>> Recreation (1932), p. 1
>>>>
>>>
>>>
>>
>>
>> --
>> Jonathan Yu, P.Eng. / Software Engineer, OpenShift by Red Hat / Twitter
>> (@jawnsy) is the quickest way to my heart
>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__twitter.com_jawnsy&d=DQMFaQ&c=_hRq4mqlUmqpqlyQ5hkoDXIVh6I6pxfkkNxQuL0p-Z0&r=8IlWeJZqFtf8Tvx1PDV9NsLfM_M0oNfzEXXNp-tpx74&m=_iU9xf0GzcebBNDBdsmcTnQ0IrzCflnn8SAyRzqeiew&s=hVfGgNVeNnYk2AfZYVyRp0hhdQcC_4JTtRnPnAsGILA&e=>
>>
>> *“A master in the art of living draws no sharp distinction between his
>> work and his play; his labor and his leisure; his mind and his body; his
>> education and his recreation. He hardly knows which is which. He simply
>> pursues his vision of excellence through whatever he is doing, and leaves
>> others to determine whether he is working or playing. To himself, he always
>> appears to be doing both.”* — L. P. Jacks, Education through Recreation
>> (1932), p. 1
>>
>
> _______________________________________________
> users mailing list
> [email protected]
> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.
> openshift.redhat.com_openshiftmm_listinfo_users&d=DQICAg&c=_
> hRq4mqlUmqpqlyQ5hkoDXIVh6I6pxfkkNxQuL0p-Z0&r=8IlWeJZqFtf8Tvx1PDV9NsLfM_
> M0oNfzEXXNp-tpx74&m=_iU9xf0GzcebBNDBdsmcTnQ0IrzCflnn8SAyRzqeiew&s=
> r4qjtqGXHC8vpZNMal9MgaQVOQ1o_FNDBQAVZ-T8guk&e=
>
>
_______________________________________________
users mailing list
[email protected]
http://lists.openshift.redhat.com/openshiftmm/listinfo/users

Reply via email to