Skip to content
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

java: add graphviz to container image #38

Merged
merged 3 commits into from
Oct 9, 2019

Conversation

averikitsch
Copy link
Contributor

For sample GoogleCloudPlatform/java-docs-samples#1610
Reference node PR #31

java/java11/Dockerfile Outdated Show resolved Hide resolved
@averikitsch
Copy link
Contributor Author

@grayside any reason you used ; instead of &&?

java/java11/Dockerfile Outdated Show resolved Hide resolved
@chingor13 chingor13 merged commit b51d709 into googleapis:master Oct 9, 2019
@grayside
Copy link
Contributor

Not sure how I missed this notification, sorry. Since I was asked I'll go ahead and fill in my answer.

The change in this PR ended up on:

RUN apt-get update -y && \
    apt-get install -y graphviz && \
    rm -rf /var/lib/apt/lists/*

However, I generally recommend (and use) something more like this (from the node-12 image)

RUN set -ex; \
  apt-get update -y; \
  apt-get install -y \
    graphviz \
    ; \
  rm -rf /var/lib/apt/lists/*

Reasons I do this:

  • Semicolons are less visually intrusive
  • set -e preserves the "stop-on-error" behavior of &&
  • set -x outputs the executed commands during build, removing some of the mystery when reading build logs
  • One package per line makes diffs easier to read, especially once you get more than ~5 packages.

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.

3 participants