Uploaded image for project: 'Product Technical Learning'
  1. Product Technical Learning
  2. PTL-15530

DO188v4.18:Ch04s04: WORKDIR is instead preserved between “nested” builds:

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • DO188 - RHOCP4.18-en-1-20250430
    • DO188
    • False
    • Hide

      None

      Show
      None
    • False
    • 4
    • en-US (English)

      Please fill in the following information:


      URL: https://role.rhu.redhat.com/rol-rhu/app/courses/do188-4.18/pages/ch04s04 
      Reporter RHNID:  acancell@redhat.com 
      Section Title:              Guided Exercise: Build Images with Advanced Containerfile Instructions                                                           

      Issue description: 

       WORKDIR is instead preserved between “nested” builds:
      ~~~
      #Containerfile.a
      FROM registry.access.redhat.com/ubi9/ubi:9.5
      WORKDIR /opt

      $ podman build -f Containerfile.a -t test:1

      #Containerfile.b
      FROM localhost/test:1
      CMD ["pwd"]

      $ podman build -f Containerfile.b -t test:2

      $ podman run test:2
      /opt ← OUTPUT
      ~~~

      Without this clarification, step 2.3 (where we COPY --from) doesn't make sense, since the reader can't figure out why the source is "/app/numbers.txt" and not "/numbers.txt" 

       

      Steps to reproduce:

       

      Workaround:

       

      Expected result:

              asernabo@redhat.com Alejandro Serna-Borja
              chetan-rhls Chetan Tiwary
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: