-
-
Save sivalingams/2c6f82c8d068676705836e2e3553bef4 to your computer and use it in GitHub Desktop.
dep Container Builder image recipe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2017 Google Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# https://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
# Cloud Build for Go dep image | |
# gcloud container builds submit --config=cloudbuild.yaml --substitutions=_DEP_COMMIT=master . | |
steps: | |
# Clone dep tool | |
- name: 'gcr.io/cloud-builders/git' | |
args: ['clone', '-n', 'https://github.com/golang/dep.git', 'src/github.com/golang/dep'] | |
- name: 'gcr.io/cloud-builders/git' | |
args: ['checkout', '$_DEP_COMMIT'] | |
dir: 'src/github.com/golang/dep' | |
# Build into image | |
- name: 'gcr.io/cloud-builders/go:wheezy' | |
args: ['get', '-v', 'github.com/golang/dep/cmd/dep'] | |
env: ['GOPATH=.'] | |
- name: 'gcr.io/cloud-builders/docker' | |
args: ['build', | |
'-t', 'gcr.io/$PROJECT_ID/dep:$BUILD_ID', | |
'--label', 'DEP_COMMIT=$_DEP_COMMIT', | |
'-f', 'Dockerfile', | |
'.'] | |
images: | |
- 'gcr.io/$PROJECT_ID/dep:$BUILD_ID' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Copyright 2017 Google Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# https://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
if [ -z "$GOPATH" ]; then | |
echo "dep: GOPATH must be set" 1>&2 | |
exit 1 | |
fi | |
export GOPATH="$(readlink -f "$GOPATH")" | |
/go/bin/dep "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2017 Google Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# https://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
FROM debian:jessie-slim | |
RUN apt-get update && apt-get install -y --no-install-recommends \ | |
git-core \ | |
mercurial \ | |
subversion \ | |
&& rm -rf /var/lib/apt/lists/* | |
COPY bin/dep /go/bin/dep | |
COPY dep.bash /bin/dep.bash | |
ENTRYPOINT ["/bin/dep.bash"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment