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

the last version not working. missed value for ARG AWS_IAM_AUTH_VERSION_URL #6

Closed
Gershon-A opened this issue May 21, 2020 · 7 comments

Comments

@Gershon-A
Copy link

Hello,
the last version not working.
Seem here is missed value for ARG AWS_IAM_AUTH_VERSION_URL
I adding it as following and all work

ARG AWS_IAM_AUTH_VERSION_URL="https://amazon-eks.s3.us-west-2.amazonaws.com/1.16.8/2020-04-16/bin/linux/amd64/aws-iam-authenticator"
@ozbillwang
Copy link
Collaborator

ozbillwang commented May 22, 2020

Value of ARG in Dockerfile is optional, if don't feed the value, it will use the default one, if set.

My script will handle the AWS_IAM_AUTH_VERSION_URL automatically when new version released

# aws-iam-authenticator latest
iam_auth=$(curl -s https://docs.aws.amazon.com/eks/latest/userguide/install-aws-iam-authenticator.html|grep iam-auth |grep linux|head -1)
iam_auth_url=$(echo ${iam_auth} |grep -oP '(?<=curl -o aws-iam-authenticator )[^<]*'|head -1)

build --no-cache ...... --build-arg AWS_IAM_AUTH_VERSION_URL="${iam_auth_url}" -t ${image}:${tag} .

Please provide the detail, on which tag which image do you have issue.

@Gershon-A
Copy link
Author

Sorry for the late response.
I used docker pull alpine/k8s:1.13.12

@ozbillwang
Copy link
Collaborator

I can

$ docker run -ti --rm alpine/k8s:1.13.12 aws-iam-authenticator version
{"Version":"v0.5.0","Commit":"1cfe2a90f68381eacd7b6dcfa2bf689e76eb8b4b"}

@Gershon-A
Copy link
Author

The problem occurs when I build the repo locally

Step 9/13 : RUN curl -LO ${AWS_IAM_AUTH_VERSION_URL} &&     mv aws-iam-authenticator /usr/bin/aws-iam-authenticator &&     chmod +x /usr/bin/aws-iam-authenticator
 ---> Running in cabcb827ec9c
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information
The command '/bin/sh -c curl -LO ${AWS_IAM_AUTH_VERSION_URL} &&     mv aws-iam-authenticator /usr/bin/aws-iam-authenticator &&     chmod +x /usr/bin/aws-iam-authenticator' returned a non-zero code: 2```

@ozbillwang
Copy link
Collaborator

ozbillwang commented May 27, 2020

I see. You try to docker build by yourself. but it doesn't work as this way.

The design for this repo is,

  1. travis CI defines the kubernetes version in .travis.yml
env:
  - tag=1.18.2
  - tag=1.17.5
  - tag=1.16.8
  - tag=1.15.11
  - tag=1.14.9
  - tag=1.13.12
  1. script build.sh will get the latest version of AWS IAM Auth, helm, and rest tools.

  2. Travis CI will trigger the build daily to run the script build.sh

script:
  - bash ./build.sh

So if you want to reuse this repo to build your own image, you can do this way:

export tag=1.13.12

bash ./build.sh

then you need adjust the tag to other kubernetes version and run the build script again.

@ozbillwang
Copy link
Collaborator

@Gershon-A
Copy link
Author

Thank You!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants