mirror of https://github.com/linkerd/linkerd2.git
Fix Go and Proxy dependency image SHAs (#117)
The image tags for gcr.io/runconduit/go-deps and gcr.io/runconduit/proxy-deps were not updating to account for all changes in those images. Modify SHA generation to include all files that affect the base dependency images. Also add instructions to README.md for updating hard-coded SHAs in Dockerfile's. Fixes #115 Signed-off-by: Andrew Seigner <andrew@sig.gy>
This commit is contained in:
parent
90b5ddfb00
commit
caeb83a526
|
|
@ -1150,4 +1150,3 @@ dependencies = [
|
|||
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
|
||||
"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"
|
||||
"checksum zip 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "21c4067ff2f91926cb9aef8a8a55f8568b0f2631bb6b827d0fb9770ff5894e43"
|
||||
|
||||
|
|
|
|||
22
README.md
22
README.md
|
|
@ -67,6 +67,28 @@ kubectl --namespace=conduit get all
|
|||
conduit dashboard
|
||||
```
|
||||
|
||||
## Updating Docker dependencies
|
||||
|
||||
The Rust proxy and Go Docker images rely on base dependency images with
|
||||
hard-coded SHA's:
|
||||
|
||||
`gcr.io/runconduit/go-deps` depends on
|
||||
- `Gopkg.lock`
|
||||
- `Dockerfile-go-deps`
|
||||
|
||||
`gcr.io/runconduit/proxy-deps` depends on
|
||||
- `Cargo.lock`
|
||||
- `proxy/Dockerfile-deps`
|
||||
|
||||
If any of these files change, update the Dockerfile SHA's with:
|
||||
|
||||
```
|
||||
GO_DEPS_SHA=$(sh -c ". bin/_tag.sh && go_deps_sha")
|
||||
PROXY_DEPS_SHA=$(sh -c ". bin/_tag.sh && proxy_deps_sha")
|
||||
|
||||
find . -type f -name 'Dockerfile*' -exec sed -i '' -e 's/gcr\.io\/runconduit\/go-deps:[^ ]*/gcr\.io\/runconduit\/go-deps:'$GO_DEPS_SHA'/g' {} \;
|
||||
find . -type f -name 'Dockerfile*' -exec sed -i '' -e 's/gcr\.io\/runconduit\/proxy-deps:[^ ]*/gcr\.io\/runconduit\/proxy-deps:'$PROXY_DEPS_SHA'/g' {} \;
|
||||
```
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@ git_sha() {
|
|||
git rev-parse "$1" | cut -c 1-8
|
||||
}
|
||||
|
||||
cargo_sha() {
|
||||
shasum Cargo.lock | awk '{print $1}' |cut -c 1-8
|
||||
proxy_deps_sha() {
|
||||
cat Cargo.lock proxy/Dockerfile-deps | shasum - | awk '{print $1}' |cut -c 1-8
|
||||
}
|
||||
|
||||
gopkg_sha() {
|
||||
shasum Gopkg.lock | awk '{print $1}' |cut -c 1-8
|
||||
go_deps_sha() {
|
||||
cat Gopkg.lock Dockerfile-go-deps | shasum - | awk '{print $1}' |cut -c 1-8
|
||||
}
|
||||
|
||||
dir_tag() {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ set -eu
|
|||
|
||||
image=$(docker_maybe_build . \
|
||||
"$(docker_repo go-deps)" \
|
||||
"$(gopkg_sha)" \
|
||||
"$(go_deps_sha)" \
|
||||
Dockerfile-go-deps)
|
||||
|
||||
echo "$image"
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ set -eu
|
|||
|
||||
image=$(docker_maybe_build . \
|
||||
"$(docker_repo proxy-deps)" \
|
||||
"$(cargo_sha)" \
|
||||
"$(proxy_deps_sha)" \
|
||||
proxy/Dockerfile-deps)
|
||||
|
||||
echo "$image"
|
||||
|
|
|
|||
|
|
@ -28,5 +28,5 @@ docker_image web "${tag}"
|
|||
docker_image cli "${tag}"
|
||||
docker_image cli-bin "${tag}"
|
||||
|
||||
docker_image go-deps "$(gopkg_sha)"
|
||||
docker_image proxy-deps "$(cargo_sha)"
|
||||
docker_image go-deps "$(go_deps_sha)"
|
||||
docker_image proxy-deps "$(proxy_deps_sha)"
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@ set -eu
|
|||
. bin/_tag.sh
|
||||
|
||||
docker_pull base 2017-10-30.01 || true
|
||||
docker_pull go-deps "$(gopkg_sha)" || true
|
||||
docker_pull proxy-deps "$(cargo_sha)" || true
|
||||
docker_pull go-deps "$(go_deps_sha)" || true
|
||||
docker_pull proxy-deps "$(proxy_deps_sha)" || true
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@ set -eu
|
|||
. bin/_tag.sh
|
||||
|
||||
docker_push base 2017-10-30.01
|
||||
docker_push go-deps "$(gopkg_sha)"
|
||||
docker_push proxy-deps "$(cargo_sha)"
|
||||
docker_push go-deps "$(go_deps_sha)"
|
||||
docker_push proxy-deps "$(proxy_deps_sha)"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
## compile binaries
|
||||
FROM gcr.io/runconduit/go-deps:e258aef9 as golang
|
||||
FROM gcr.io/runconduit/go-deps:41719552 as golang
|
||||
WORKDIR /go/src/github.com/runconduit/conduit
|
||||
COPY cli cli
|
||||
COPY controller controller
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
## compile controller services
|
||||
FROM gcr.io/runconduit/go-deps:e258aef9 as golang
|
||||
FROM gcr.io/runconduit/go-deps:41719552 as golang
|
||||
WORKDIR /go/src/github.com/runconduit/conduit
|
||||
COPY controller controller
|
||||
COPY pkg pkg
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
## compile proxy-init utility
|
||||
FROM gcr.io/runconduit/go-deps:e258aef9 as golang
|
||||
FROM gcr.io/runconduit/go-deps:41719552 as golang
|
||||
WORKDIR /go/src/github.com/runconduit/conduit
|
||||
COPY ./proxy-init ./proxy-init
|
||||
RUN CGO_ENABLED=0 GOOS=linux go install -v -a -installsuffix cgo ./proxy-init/
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
## compile rust proxy
|
||||
FROM gcr.io/runconduit/proxy-deps:944e9e27 as build
|
||||
FROM gcr.io/runconduit/proxy-deps:e01062fe as build
|
||||
WORKDIR /usr/src/conduit
|
||||
# Ranked roughly from least to most likely to change. Cargo.lock is the least likely
|
||||
# because it is supposed to be cached in the deps base image.
|
||||
|
|
|
|||
|
|
@ -24,4 +24,4 @@ COPY proxy ./proxy
|
|||
# Cache as much as possible; but don't keep aroud the artifact or things might get
|
||||
# confusing.
|
||||
RUN cargo build -p conduit-proxy && rm target/debug/conduit-proxy
|
||||
RUN cargo build -p conduit-proxy --release && rm target/release/conduit-proxy
|
||||
RUN cargo build -p conduit-proxy --release && rm target/release/conduit-proxy
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ RUN $HOME/.yarn/bin/yarn install --pure-lockfile
|
|||
RUN $HOME/.yarn/bin/yarn webpack
|
||||
|
||||
## compile go server
|
||||
FROM gcr.io/runconduit/go-deps:e258aef9 as golang
|
||||
FROM gcr.io/runconduit/go-deps:41719552 as golang
|
||||
WORKDIR /go/src/github.com/runconduit/conduit
|
||||
COPY web web
|
||||
COPY controller controller
|
||||
|
|
|
|||
Loading…
Reference in New Issue