Skip to content

Update image to extract java ca certs - #343

Merged
chanseokoh merged 2 commits into
masterfrom
update-ca-certs-image
Mar 29, 2019
Merged

chanseokoh merged 2 commits into
masterfrom
update-ca-certs-image

Conversation

@chanseokoh

Copy link
Copy Markdown
Member

Fixes #342.

Note we have tests to connect to www.google.com, such as this.

@chanseokoh

Copy link
Copy Markdown
Member Author

@GoogleContainerTools/java-tools-build I got a confirmation that we should stop using gcr.io/google_appengine/debian8 and migrate to gcr.io/google_appengine/debian9.

@chanseokoh
chanseokoh requested a review from a team March 28, 2019 19:39

@briandealwis briandealwis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could simplify this and just copy out /etc/ssl/certs/java/cacerts from gcr.io/google-appengine/openjdk?

Comment thread .travis.yml Resolved
Comment thread cacerts/java.bzl
# Install the certs in the builder image.
cid=$(docker run -d {1} sh -c "apt-get update && apt-get install -y -q ca-certificates-java")
# ln: the default non-interactive shell is dash, which interferes with the post install script.
cid=$(docker run -d {1} sh -c "ln -sf bash /bin/sh && apt-get update && apt-get install -y -q ca-certificates-java")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is odd as from poking in the .deb, the postinst file has a #!/bin/bash as its shebang.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, maybe it's one of the prereqs.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It uses !#/bin/sh, but it has == (double equals) in a conditional that bash tolerates but dash doesn't.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, there may be a script with the bash shebang, but that is not the script causing an issue.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error we see is from the jks-keystore script at line 56.

Running hooks in /etc/ca-certificates/update.d...

/etc/ca-certificates/update.d/jks-keystore: 56: [: amd64: unexpected operator
done.

The version of the package being installed is 20170929~deb9u1.

# dpkg -l | grep certif
ii  ca-certificates              20161130+nmu1+deb9u1  all          Common CA certificates
ii  ca-certificates-java         20170929~deb9u1       all          Common CA certificates (JKS keystore)

jks-keystore.hook.in from the matching date 20170929 has !#/bin/sh and uses == at line 56: https://salsa.debian.org/java-team/ca-certificates-java/blob/debian/20170929/debian/jks-keystore.hook.in#L56

@chanseokoh

Copy link
Copy Markdown
Member Author

No idea about openjdk. Not even sure why we are using gcr.io/google_appengine/debian, as I think we just download the ca-certificates-java package from the public Debian repository. I thought I'd rather not change the behavior until we understand the details.

@chanseokoh
chanseokoh merged commit 3c29f81 into master Mar 29, 2019
@chanseokoh
chanseokoh deleted the update-ca-certs-image branch March 29, 2019 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants