Skip to content

Use Dockerfile file paths when using Sync #1581

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alewis001 opened this issue Feb 1, 2019 · 9 comments
Closed

Use Dockerfile file paths when using Sync #1581

alewis001 opened this issue Feb 1, 2019 · 9 comments

Comments

@alewis001
Copy link
Contributor

Desired Behavior

Files matching the sync pattern are copied to their locations as defined in the Dockerfile.

E.g.

Dockerfile:

# Start with OL runtime.
FROM open-liberty:kernel

# Configure the features and JVM settings for the Server
COPY server.xml /config/
COPY jvm.options /config/

# Copy shared/sttic libraries into a global location.
COPY lib /config/lib/global

# Add the Azure Certificate for Redis to enable HTTPS connection. 
COPY azure-redis.cer /opt/ol/wlp/output/defaultServer/resources/security/
WORKDIR /opt/ol/wlp/output/defaultServer/resources/security/
RUN keytool -noprompt -importcert -file azure-redis.cer -alias azure-redis -keystore key.jks -storepass Liberty -storetype jks

# Copy in the application
COPY myapp.war /config/dropins

In my particular case, as OpenLiberty supports dynamic updates of the server.xml and any wars deployed to it, I believe it would be useful to have the sync feature be able to copy those files to the active container based on their location as specified in the Dockerfile rather than having to duplicate the "config" in two places.

I'm able to get the functionality I'm looking for with Skaffold 0.22.0 but I currently need to:

  • Update the Dockerfile to include WORKDIR / at the end of the file.
  • Set the sync targets in skaffold.yaml to be the same paths as defined in the Dockerfile.
@r2d4
Copy link
Contributor

r2d4 commented Feb 3, 2019

+1 ref #1166

@alewis001
Copy link
Contributor Author

alewis001 commented Apr 27, 2019 via email

@DeepMalh44
Copy link

Thank you Alex, No I only downloaded the Azurewebsites.cer (as Base64) from browser and then thought running the following should help me generate the .jks file and I thought I can give it a name Azurewebsites.jsk. Am I doing something completely wrong here?

I am trying to generate an Open Liberty Docker container and using it in Azure web-app and whcih has to talk to another Azure web api (https) and it is failing currently with error of (ROR ] CWPKI0022E: SSL HANDSHAKE FAILURE: A signer with SubjectDN CN=*.azurewebsites.net was sent from the target host. The signer might need to be added to local trust store /opt/ol/wlp/output/defaultServer/resources/security/key.p12).

While searching all places I came across your post and I thought this was it how I can import the Azurewebsites cer to my docker container I am building for OL.

@DeepMalh44
Copy link

hey Alex,
I think that was it I had to use key.jks and it resolved my issue, Thank you !

@alewis001
Copy link
Contributor Author

alewis001 commented Apr 27, 2019 via email

@DeepMalh44
Copy link

Thank you Alex, your POST above was GREAT HELP to me! I will make sure to post questions on appropriate forums but your DOCKER FILE post above helped me tons! Have a great weekend!

@tejal29
Copy link
Contributor

tejal29 commented Aug 22, 2019

@alewis001 this is be fixed now with #2088 and #1812

Can you please verify?

@alewis001
Copy link
Contributor Author

Sure, I will attempt to verify this as soon as I can.

@tejal29
Copy link
Contributor

tejal29 commented Sep 19, 2019

This is fixed in #2008 and #1812. Please re-open if you still see this.

@tejal29 tejal29 closed this as completed Sep 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants