-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix(dockerfile): add yarn #4844
Conversation
Thanks so much for taking the time to contribute to the AWS CDK ❤️ We will shortly assign someone to review this pull request and help get it
|
Dockerfile
Outdated
@@ -22,7 +22,10 @@ RUN yum -y --security update \ | |||
&& grep " node-v$NODE_VERSION-linux-x64.tar.xz\$" SHASUMS256.txt | sha256sum -c - \ | |||
&& tar -xJf "node-v$NODE_VERSION-linux-x64.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \ | |||
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \ | |||
&& rm "node-v$NODE_VERSION-linux-x64.tar.xz" SHASUMS256.txt | |||
&& rm "node-v$NODE_VERSION-linux-x64.tar.xz" SHASUMS256.txt \ | |||
&& curl -fsSLO "https://yarnpkg.com/latest.tar.gz" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably should add a hash verification, like is done for node above. See docker-node Dockerfile as an example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lastest version is ok or shall I fix the yarn version @nmussy ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed the version to 1.19.1
let me know if you'd like to change it otherwise :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't tested your Dockerfile, but it seems you're missing the ln
commands required to add yarn
to the path (see example).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it depends on how you want to save the yarn binary but atm the yarn is actually exported in the path becuase is extracted directly into /usr/local
In the current PR I used the same extraction command than the one used for node,
tar zvxf yarn-v$YARN_VERSION.tar.gz -C /usr/local --strip-components=1 --no-same-owner
That means that the first component from yarn-v<numbers>
will be used to save the file -> yarn
.
There's also the possibility of using the symlink while preserving the version number ->
&& tar zvxf yarn-v$YARN_VERSION.tar.gz -C /opt/ --no-same-owner \
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn
I chose the first one just to be consistent with the node extraction but if you think the latter is better (more clear) then we can go for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, I missed the --strip-components=1
. 😄
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
2a19472
to
d8b0f5a
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request is now being automatically merged. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Install the latest yarn version in the docker image.
Fixes #4843
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license