Good morning team, so I am trying to change some f...
# all-things-deployment
m
Good morning team, so I am trying to change some files of the datahubfront service. My "problem" is that I can't find the directory inside of the service's container where those same files are. I have been reading its Dockerfile but haven't found much. Could someone please point the directory/directories out?? Thanks in advance!
i
Hello Pablo, Which files are you trying to find in the datahub-frontend container?
m
The main files would be ManageAccount.tsx and HomePageHeader.tsx (that can be found in the project's Github under /datahub/datahub-web-react/serc/app/shared)
But I imagine all the files should be under a same directory right??
i
The files in question are in
datahub-web-react/src/app
in the source code. The dockerfile reads the entire datahub code repository, builds it and then uses the built artifacts as the basis for the image that gets shipped out to customers.
Copy code
RUN cd datahub-src \
    && ./gradlew :datahub-web-react:build -x test -x yarnTest -x yarnLint \
    && ./gradlew :datahub-frontend:dist -PenableEmber=${ENABLE_EMBER} -PuseSystemNode=${USE_SYSTEM_NODE} -x test -x yarnTest -x yarnLint \
    && cp datahub-frontend/build/distributions/datahub-frontend.zip ../datahub-frontend.zip \
    && cd .. && rm -rf datahub-src && unzip datahub-frontend.zip

FROM base as prod-install
COPY --from=prod-build /datahub-frontend /datahub-frontend/
RUN chown -R datahub:datahub /datahub-frontend && chmod 755 /datahub-frontend
m
So if I have understood it correctly, the
COPY . datahub-src
copies the code of the repository so that the
RUN
command can build it, right? Is the file hierarchy of the
datahub-src
the same that in the
datahub-web-react
directory of the source code?
i
Is the file hierarchy of the datahub-src the same that in the datahub-web-react directory of the source code?
Yes but the compiled output of the build command will not be. If I’m not mistaken the react code is compiled & minified. I could be wrong though I’m not familiar with the frontend build process
m
I just it to know in order to replace some files before the
RUN
command is executed. The minified would make sense as when I tried looking for its files in the container I didn't find much. Thanks!!
Hello again @incalculable-ocean-74010 I am trying to create a Dockerfile for the datahub-front as mentioned in previous messages. I have found that the Dockerfile used here has a few errors, being the most important one this one that I am encountering right one:
Copy code
Step 13/27 : RUN cd datahub-src     && ./gradlew :datahub-web-react:build -x test -x yarnTest -x yarnLint     && ./gradlew :datahub-frontend:dist -PenableEmber=${ENABLE_EMBER} -PuseSystemNode=${USE_SYSTEM                             _NODE} -x test -x yarnTest -x yarnLint     && cp datahub-frontend/build/distributions/datahub-frontend.zip ../datahub-frontend.zip     && cd .. && rm -rf datahub-src && unzip datahub-frontend.zip
 ---> Running in dba94d5d2932
/bin/sh: ./gradlew: not found
The command '/bin/sh -c cd datahub-src     && ./gradlew :datahub-web-react:build -x test -x yarnTest -x yarnLint     && ./gradlew :datahub-frontend:dist -PenableEmber=${ENABLE_EMBER} -PuseSystemNode=${USE                             _SYSTEM_NODE} -x test -x yarnTest -x yarnLint     && cp datahub-frontend/build/distributions/datahub-frontend.zip ../datahub-frontend.zip     && cd .. && rm -rf datahub-src && unzip datahub-frontend.zip'                              returned a non-zero code: 127
Have you, by any chance, experienced this error? Thanks for the help!
i
Hello Pablo, I am not familiar with the error, that said it seems that you are trying to run
gradlew
where it does not exist? Change
Copy code
RUN cd datahub-src \
    && ./gradlew :datahub-web-react:build -x test -x yarnTest -x yarnLint \
    && ./gradlew :datahub-frontend:dist -PenableEmber=${ENABLE_EMBER} -PuseSystemNode=${USE_SYSTEM_NODE} -x test -x yarnTest -x yarnLint \
    && cp datahub-frontend/build/distributions/datahub-frontend.zip ../datahub-frontend.zip \
    && cd .. && rm -rf datahub-src && unzip datahub-frontend.zip
To
Copy code
RUN cd datahub-src 
RUN ls -lhart .
RUN ./gradlew :datahub-web-react:build -x test -x yarnTest -x yarnLint \
    && ./gradlew :datahub-frontend:dist -PenableEmber=${ENABLE_EMBER} -PuseSystemNode=${USE_SYSTEM_NODE} -x test -x yarnTest -x yarnLint \
    && cp datahub-frontend/build/distributions/datahub-frontend.zip ../datahub-frontend.zip \
    && cd .. && rm -rf datahub-src && unzip datahub-frontend.zip
And see if
gradlew
is present in the
datahub-src
folder.