Comments (13)
Seems like at a minimum we should have a conditional guard around deleting existing creds only if DOCKER_HUB_*
is specified.
from elastic-ci-stack-for-aws.
I finally got around to testing this... Works perfectly, thank you! @toolmantim
from elastic-ci-stack-for-aws.
Oh man, it took me a while to figure this one out. I tried to docker login
via the env script, as suggested in the README, but kept getting 403s... now I know why! 😉
My "env" file now contains the following 2 additional lines...
echo "Removing /etc/buildkite-agent/hooks/pre-command, as it messes with docker login"
rm /etc/buildkite-agent/hooks/pre-command
docker login ...
from elastic-ci-stack-for-aws.
Hrm, why do we do the login stuff in a pre-command hook rather than the environment hook?
from elastic-ci-stack-for-aws.
@lox I have no idea why it's in the pre-command hook, no reason we can't move it into the environment hook.
from elastic-ci-stack-for-aws.
I suspect I was trying to ensure that credentials from a past command couldn't be accidentally leaked to a subsequent command, but the env hook should do that fine.
from elastic-ci-stack-for-aws.
Doesn't the docker login
command always look the same, i.e. could the hook not just support a generic login mechanism? I wouldn't mind the config cleanup, if I could provide docker credentials some other way...
From looking at the pre-command hook, email would need to be optional (it's deprecated with newer docker versions), and we would need a way to add the "repository service url".
We're using quay.io
and the login command in the end looks like this: docker login -u username -p password quay.io
.
from elastic-ci-stack-for-aws.
I just pushed changes for this to #127
@bforchhammer this would look like this now for quay.io:
export DOCKER_LOGIN_USER=username
export DOCKER_LOGIN_PASSWORD=password
export DOCKER_LOGIN_SERVER=quay.io
For Docker Hub it's simply:
export DOCKER_LOGIN_USER=username
export DOCKER_LOGIN_PASSWORD=password
For AWS ECR it's:
export AWS_ECR_LOGIN=true
For ECR registries in other accounts:
export AWS_ECR_LOGIN_REGISTRY_IDS=account-id-1,account-id-2
I should probably update the Readme to read like the above… with sub-headings for whichever registry you use.
from elastic-ci-stack-for-aws.
Awesome, great stuff @bforchhammer!
from elastic-ci-stack-for-aws.
Oh before I forget, please note that the actual env variable name in code is actually DOCKER_LOGIN_USER
and not DOCKER_LOGIN_USERNAME
... just in case anyone stumbles on this issue and tries to follow your instructions above ;-)
from elastic-ci-stack-for-aws.
@bforchhammer thanks!
from elastic-ci-stack-for-aws.
@lox how can i see the debug messages for env hooks . i have put docker login credential there and nothing is happenning , not sure how to debug if those scripts are getting invoked or not. i have put dummy export TEST='sample' to test but i can't even see that in environment tab on build interface
from elastic-ci-stack-for-aws.
Wanna send us an email at [email protected] with some context @singhrcode? Doesn't sound related to the above issue.
from elastic-ci-stack-for-aws.
Related Issues (20)
- CI Stack not working for ARM64 instances HOT 3
- Support configuring the log retention for the autoscaling stack HOT 4
- Docker version upgrade in 6.8.0 messes with voluming behavious HOT 1
- Support Docker v25 for remote image caching HOT 4
- v6.15.0 is missing AWSRegion2AMI mappings for all regions except us-east-1 HOT 9
- Add native support for IPv6 HOT 1
- Autoscaling not functioning as expected on queues specified as tags HOT 2
- Documentation clarification: what happens if no spot instances are available? HOT 2
- Stack creation in eu-central-2 fails HOT 1
- Update aws-cli to recent version in windows image HOT 1
- Tagging for EBS volumes HOT 1
- MountTmpfsAtTemp: Option to mount tmp on ephemeral mount HOT 1
- Revisiting Issue #544: Packer SSH Key Not Fully Removed HOT 3
- Wrong stack URL in release tag v6.21.0
- `MountTmpfsAtTemp` doesn't seem to always have the desired effect HOT 2
- Encrypt the Lambda function envirornment variables created using buildkite elastic stack HOT 1
- support signed pipelines HOT 1
- v6.22.1 patch includes breaking(?) change HOT 2
- AMI is vulnerable to the regreSSHion SSH vulnerability HOT 3
- Option to hibernate agents after a timeout HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elastic-ci-stack-for-aws.