Skip to content

Pull selectively#13

Merged
solsson merged 8 commits intomasterfrom
avoid-pull-for-local-dependency
Jun 7, 2018
Merged

Pull selectively#13
solsson merged 8 commits intomasterfrom
avoid-pull-for-local-dependency

Conversation

@solsson
Copy link
Contributor

@solsson solsson commented Oct 25, 2016

For #12

Or we have to use exact tags/sha256 for all upstream images everywhere.

Building experimental solsson/build-contract-push from this branch.

@solsson
Copy link
Contributor Author

solsson commented Oct 25, 2016

solsson/build-contract-push:pr13 is the experimental build

@atamon
Copy link
Contributor

atamon commented Oct 25, 2016

I guess we could disable pulls via some option.

I haven't really understood this myself, but as you said an image that depends on a locally built image won't need to pull. But I guess that is only true if the "base image" inside the repository specifies a strict version (like node:6.8.0 for example).

@solsson solsson force-pushed the avoid-pull-for-local-dependency branch from 6a5a570 to 21186c3 Compare March 26, 2017 19:51
@solsson
Copy link
Contributor Author

solsson commented Mar 26, 2017

Rebased, previous was 6a5a570

@solsson
Copy link
Contributor Author

solsson commented May 11, 2017

Had another case of this now, with a test container doing FROM localhost:5000/yolean/my-service and build-contract declaring the build dependency:

  my-service:
    build:
      context: ../
    image: localhost:5000/yolean/my-service:${PUSH_TAG-latest}
  my-test:
    depends_on:
      - my-service
    build: ./my-test

Didn't work with the regular build-contract image, but with sha256:ca31f62dd6d149353064b2160dfa7a56b1815aa8cd60c4ff6b52707338f7ddd1 from this PR.

@solsson
Copy link
Contributor Author

solsson commented May 15, 2017

Reminder: this issue is a major gotcha. I just got an old build from a new git commit, thanks to docker cache on the build node. Turns out I was using solsson/build-contract@sha256:606333fe1c55326509e6ad4788113a17c58d2957422defb44190b7a711551ab9 instead of solsson/build-contract@sha256:ca31f62dd6d149353064b2160dfa7a56b1815aa8cd60c4ff6b52707338f7ddd1.

Will change to solsson/build-contract:pr13 with imagePullPolicy: Always for the modules that depend on this PR, so we don't accidentally upgrade.

@solsson solsson force-pushed the avoid-pull-for-local-dependency branch from 21186c3 to 9a2a394 Compare May 24, 2018 12:52
@solsson solsson changed the title WIP pull selectively Pull selectively May 24, 2018
solsson added 2 commits May 24, 2018 20:30
with localhost:5000/... image names if you forget the PUSH_TAG
so let's have it in the example even if some builds don't use it
@solsson
Copy link
Contributor Author

solsson commented May 24, 2018

I've rebased and built solsson/build-contract@sha256:f01f8bc564477d882bbda0fcb15b8eef3118aae5031dc5ab5e2daaa64a183d40

Also included a commit that was quite essential for #36.

@atamon We should use this build all over the place, and merge if not a lot breaks. That'll give us a single build-contract image to keep track of.

I've forgotten if there were any downside with d2a9cb1 or not.

requiring us to use images tagged with sha,
which is a requirement anyway for builds to be stable over time.

If we really want pull on every build we must find
a docker-compose feature akin to imagePullPolicy in k8s
@solsson
Copy link
Contributor Author

solsson commented May 25, 2018

docker/compose#3574 (comment) suggests what I was looking for and docker/compose#3574 (comment) and refereces the kubernetes solution like I did in 6671feb.

I've built solsson/build-contract:pr13@sha256:a95bc228835d01bd49dec69d17ba2e777f81f840bc335d0fdf6814e3bbae3e1b that runs without the pull.

Will make another build on monday with latest nodejs and npm because fixes in https://github.com/npm/npm/releases/tag/v6.1.0 may apply to our monorepo solution.

@solsson solsson mentioned this pull request Jun 3, 2018
@solsson solsson merged commit 3c4d558 into master Jun 7, 2018
@solsson
Copy link
Contributor Author

solsson commented Jun 7, 2018

Built from master now, with https://github.com/Yolean/docker-base/releases/tag/docker.node.9d02ee07572e98ce3db9018ac6ee2a70b12464498d3ea36aca0e9d6fb660eba7

solsson/build-contract@sha256:d7e7108e6e9d68a2b9afdefce68c7a9954edda9a5d09dea8fb4fc9148c940dc4

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