Confirmed integration with Node - Alpine Linux
See original GitHub issueWhich Category is your question related to? Package Installation / CI CD Usage
What AWS Services are you utilizing? I am using a vanilla installation of the Amplify CLI for Javascript (React) which only uses the Hosting plugin for serving content out of CloudFront / S3.
Provide additional details e.g. code snippets I am running the multi-environment configuration for Amplify (1.1.7) locally (MacOS, Node 10.x via NVM), and everything seems to work perfectly.
Question: Has anyone done any testing with this toolchain on a Dockerized Node environment using Alpine Linux? Is there any additional configuration or constraints to be aware of?
Background:
For the CI CD pipeline we are using GitLab CI Runners, so we configured a pretty minimal Alpine Docker image (node:10-alpine) to do some testing with the toolchain.
When running our tests in the environment I noticed some odd behaviors when running commands for both amplify init
and amplify configure project
via headless shell scripts. After a little bit of digging I found that just running the container and attempting a standard execution of amplify configure
introduced some odd behavior.
Docker Image:
FROM node:10-alpine
RUN mkdir -p /opt/node/app/src
RUN apk -v --update add \
python \
py-pip \
git \
yarn \
&& \
pip install awscli --upgrade && \
aws --version && \
apk -v --purge del py-pip && \
rm -rf /var/cache/apk/*
RUN yarn global add @aws-amplify/cli && \
WORKDIR /opt/node/app/src
Inside the Docker Container:
$ aws configure --profile default
...
$ amplify configure
? Select the backend providers. (Press <space> to select, <a> to toggle all, <i>
to invert selection)
Note: In our pipeline usage, we are not manually configuring the AWS CLI profile, it is being automatically setup.
You can see that the behavior of the CLI prompts seems to be off, not matching the typical implementation in a local machine:
$ amplify configure
Follow these steps to set up access to your AWS account:
Sign in to your AWS administrator account:
https://console.aws.amazon.com/
Press Enter to continue
...
When I looked into the package installation from yarn global add @aws-amplify/cli
I noted a few warnings related to Grunt, which possibly could be impacting some of the CLI prompts, but I don’t see anything blatantly causing an error:
$ yarn global add @aws-amplify/cli
yarn global v1.13.0
[1/4] Resolving packages...
warning @aws-amplify/cli > amplify-category-function > grunt-aws-lambda > glob > minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning @aws-amplify/cli > eslint > file-entry-cache > flat-cache > circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
warning @aws-amplify/cli > amplify-category-auth > jest > jest-cli > prompts > kleur@2.0.2: Please upgrade to kleur@3 or migrate to 'ansi-colors' if you prefer the old syntax. Visit <https://github.com/lukeed/kleur/releases/tag/v3.0.0\> for migration path(s).
warning @aws-amplify/cli > amplify-category-function > grunt-aws-lambda > npm > request > node-uuid@1.4.8: Use uuid module instead
warning @aws-amplify/cli > amplify-category-function > grunt-aws-lambda > npm > request > hawk > boom@2.10.1: This version is no longer maintained. Please upgrade to the latest version.
warning @aws-amplify/cli > amplify-category-function > grunt-aws-lambda > npm > request > hawk > hoek@2.16.3: This version is no longer maintained. Please upgrade to the latest version.
warning @aws-amplify/cli > amplify-category-function > grunt-aws-lambda > npm > request > hawk > boom > hoek@2.16.3: This version is no longer maintained. Please upgrade to the latest version.
warning @aws-amplify/cli > amplify-category-function > grunt-aws-lambda > npm > request > hawk > cryptiles@2.0.5: This version is no longer maintained. Please upgrade to the latest version.
warning @aws-amplify/cli > amplify-category-function > grunt-aws-lambda > npm > request > hawk > cryptiles > boom@2.10.1: This version is no longer maintained. Please upgrade to the latest version.
warning @aws-amplify/cli > amplify-category-function > grunt-aws-lambda > npm > request > hawk > sntp > hoek@2.16.3: This version is no longer maintained. Please upgrade to the latest version.
[2/4] Fetching packages...
info There appears to be trouble with your network connection. Retrying...
info fsevents@1.2.7: The platform "linux" is incompatible with this module.
info "fsevents@1.2.7" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "@aws-amplify/cli@1.1.7" with binaries:
- amplify
Done in 143.51s.
Similarly, with the amplify init
command being executed on an existing project, I saw an odd behavior when trying to pass in the arguments for providers:
$ ./docker/gitlab-ci/scripts/amplify-init.sh
Note: It is recommended to run this command from the root of your app directory
Using default provider undefined
init failed
TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received type undefined
at Module.require (internal/modules/cjs/loader.js:631:11)
at require (internal/modules/cjs/helpers.js:22:18)
at providers.forEach (/usr/local/share/.config/yarn/global/node_modules/@aws-amplify/cli/src/lib/init-steps/s2-initProviders.js:13:28)
at Array.forEach (<anonymous>)
at run (/usr/local/share/.config/yarn/global/node_modules/@aws-amplify/cli/src/lib/init-steps/s2-initProviders.js:12:13)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
I performed a cat
and echo
on the variables being set in the shell script, and all of the JSON appears to substitute/expand properly and meet formatting requirements.
Conclusion: Well, not much a conclusion on my part other than continuing to explore the problem space using an ubuntu based Docker image; however, if anyone has explored an installation with Alpine Linux, I’d greatly appreciate some thoughts.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top GitHub Comments
Since we are using a multi-tenant GitLab CI, we currently have two init scripts: one to setup the AWS CLI client, and the other to setup the Amplify environments.
awscli-init.sh
amplify-init.sh
Note that the Amplify init script is almost identical to the recommendations in this repository for headless operations.
This issue has been automatically locked since there hasn’t been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server
*-help
channels for those types of questions.