Build fail while deploying react app to netlify - deployment

I have created a react app using create-react-app.
Now I am trying to deploy it on netlify but getting the error message.
8:16:39 AM: Build ready to start
8:16:40 AM: build-image version: 42bca793ccd33055023c56c4ca8510463a56d317
8:16:40 AM: buildbot version: 6bab8b64bbd90091082af19fedf16bf73d502e5e
8:16:40 AM: Fetching cached dependencies
8:16:40 AM: Starting to download cache of 254.7KB
8:16:40 AM: Finished downloading cache in 97.851508ms
8:16:40 AM: Starting to extract cache
8:16:40 AM: Failed to fetch cache, continuing with build
8:16:40 AM: Starting to prepare the repo for build
8:16:41 AM: No cached dependencies found. Cloning fresh repo
8:16:41 AM: git clone git#bitbucket.org:ampcomeiot/iot-web-app
8:16:43 AM: Preparing Git Reference refs/heads/master
8:16:44 AM: Starting build script
8:16:44 AM: Installing dependencies
8:16:45 AM: Downloading and installing node v8.12.0...
8:16:45 AM: Downloading https://nodejs.org/dist/v8.12.0/node-v8.12.0-linux-x64.tar.xz...
8:16:45 AM: 0.6
8:16:45 AM: %
8:16:45 AM:
###
8:16:45 AM: 4.8%
8:16:45 AM:
#####################################
8:16:45 AM: 52.0%
8:16:45 AM:
####################################
8:16:45 AM: #################################### 100.0%
8:16:45 AM: Computing checksum with sha256sum
8:16:46 AM: Checksums matched!
8:16:48 AM: Now using node v8.12.0 (npm v6.4.1)
8:16:48 AM: Attempting ruby version 2.3.6, read from environment
8:16:49 AM: Using ruby version 2.3.6
8:16:49 AM: Using PHP version 5.6
8:16:49 AM: Started restoring cached node modules
8:16:49 AM: Finished restoring cached node modules
8:16:49 AM: Started restoring cached yarn cache
8:16:49 AM: Finished restoring cached yarn cache
8:16:49 AM: Installing yarn at version 1.3.2
8:16:49 AM: Installing Yarn!
8:16:49 AM: > Downloading tarball...
8:16:49 AM: [1/2]: https://yarnpkg.com/downloads/1.3.2/yarn-v1.3.2.tar.gz --> /tmp/yarn.tar.gz.x4SAX8ROjQ
8:16:49 AM: % Total % Received % Xferd Average Speed Time Time Time Current
8:16:49 AM: Dload Upload Total Spent Left Speed
8:16:49 AM:
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
8:16:49 AM:
100 91 100 91 0 0 470
8:16:49 AM: 0 --:--:-- --:--:-- --:--:-- 471
8:16:49 AM:
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:--
8:16:49 AM: 0
0 0 0 608 0 0 1456 0 --:--:-- --:--:-- --:--:-- 60800
8:16:50 AM:
100 865k 100 865k 0 0 897k 0 --:--:-- --:--:-- --:--:-- 897k
8:16:50 AM: [2/2]: https://yarnpkg.com/downloads/1.3.2/yarn-v1.3.2.tar.gz.asc --> /tmp/yarn.tar.gz.x4SAX8ROjQ.asc
8:16:50 AM:
100 95 100 95 0 0 1891
8:16:50 AM: 0 --:--:-- --:--:-- --:--:-- 1891
8:16:50 AM:
0 0 0 612 0 0 3928 0 --:--:-- --:--:-- --:--:-- 3928
8:16:50 AM:
100 1027 100 1027 0 0 4858 0 --:--:-
8:16:50 AM: - --:--:-- --:--:-- 4858
8:16:50 AM: > Verifying integrity...
8:16:50 AM: gpg: Signature made Thu 02 Nov 2017 04:44:10 PM UTC using RSA key ID FD2497F5
8:16:50 AM: gpg: Good signature from "Yarn Packaging <yarn#dan.cx>"
8:16:50 AM: gpg: WARNING: This key is not certified with a trusted signature!
8:16:50 AM: gpg: There is no indication that the signature belongs to the owner.
8:16:50 AM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907 BBB7 1646 B01B 86E5 0310
8:16:50 AM: Subkey fingerprint: 6A01 0C51 6600 6599 AA17 F081 46C2 130D FD24 97F5
8:16:50 AM: > GPG signature looks good
8:16:50 AM: > Extracting to ~/.yarn...
8:16:50 AM: > Adding to $PATH...
8:16:50 AM: > We've added the following to your /opt/buildhome/.profile
8:16:50 AM: > If this isn't the profile of your current shell then please add the following to your correct profile:
8:16:50 AM: export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
8:16:50 AM:
8:16:51 AM: > Successfully installed Yarn 1.3.2! Please open another terminal where the `yarn` command will now be available.
8:16:51 AM: Installing NPM modules using Yarn version 1.3.2
8:16:52 AM: yarn install v1.3.2
8:16:52 AM: [1/5] Validating package.json...
8:16:52 AM: error enery-iot-app#1.0.0: The engine "node" is incompatible with this module. Expected version "10.11.0".
8:16:52 AM: error enery-iot-app#1.0.0: The engine "yarn" is incompatible with this module. Expected version "1.10.1".
8:16:52 AM: error Found incompatible module
8:16:52 AM: info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
8:16:52 AM: Error during Yarn install
8:16:52 AM: Error running command: Build script returned non-zero exit code: 1
8:16:52 AM: Failing build: Failed to build site
8:16:52 AM: failed during stage 'building site': Build script returned non-zero exit code: 1
8:16:52 AM: Finished processing build request in 12.384456438s
Below is my package.json file
{
"name": "enery-iot-app",
"version": "1.0.0",
"private": true,
"engines": {
"npm": "6.4.1",
"node": "10.11.0",
"yarn": "1.10.1"
},
"dependencies": {
"antd": "^3.0.3",
"antd-local-icon": "^0.1.3",
"apollo-boost": "^0.1.16",
"axios": "^0.18.0",
"classnames": "^2.2.5",
"clone": "^2.1.1",
"express": "^4.16.3",
"firebase": "^5.5.1",
"graphql": "0.13.0",
"history": "^4.6.3",
"nprogress": "^0.2.0",
"plotly.js": "^1.41.2",
"postcss-inline-rtl": "^0.9.8",
"react": "^16.2.0",
"react-apollo": "^2.2.4",
"react-dom": "^16.2.0",
"react-intl": "^2.3.0",
"react-placeholder": "^2.0.0",
"react-plotly.js": "^2.2.0",
"react-redux": "^5.0.4",
"react-router": "^4.1.1",
"react-router-dom": "^4.1.0",
"react-router-redux": "^5.0.0-alpha.5",
"react-scripts": "1.0.17",
"react-sidebar": "^2.3.2",
"react-smooth-scrollbar": "^8.0.6",
"react-throttle": "^0.3.0",
"react-window-size-listener": "^1.0.10",
"recharts": "^1.2.0",
"redux": "^3.6.0",
"redux-devtools": "^3.3.2",
"redux-devtools-dock-monitor": "^1.1.1",
"redux-devtools-log-monitor": "^1.2.0",
"redux-saga": "^0.16.0",
"redux-saga-firebase": "^0.14.1",
"redux-thunk": "^2.2.0",
"smooth-scrollbar": "^8.2.5",
"styled-components": "^2.2.1",
"styled-theme": "^0.3.3"
},
"devDependencies": {
"react-app-rewired": "^1.4.0"
},
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test --env=jsdom",
"eject": "react-scripts eject"
}
}
Not sure why the build is failing as I have also mentioned the engines and specified the node, npm and yarn version in a package.json file.
Even though the node version it has installed is v8.
Kindly help me to resolve this issue as I am unable to figure it out.

In the package.json you are requiring the engine versions for npm,node, and yarn.
"engines": {
"npm": "6.4.1",
"node": "10.11.0",
"yarn": "1.10.1"
},
The versions being installed on Netlify in the output above:
Installing yarn at version 1.3.2
Now using node v8.12.0 (npm v6.4.1)
Make sure these versions are required and then you can set the environment variables by adding a netlify.toml file in your project at the root of the repository.
netlify.toml
[build.environment]
NODE_VERSION = "10.11.0"
YARN_VERSION = "1.10.1"
NPM_VERSION = "6.4.1"

Related

Build error when using VS Code and docker

I'm trying to follow this: https://github.com/ecarlson94/vscode-flutter-dev-container
but hitting a build error and not able to proceed.
[+] Building 68.4s (9/10)
=> [internal] load build definition from Dockerfile-with-features 0.0s
=> => transferring dockerfile: 4.07kB 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:latest 0.0s
=> [dev_container_auto_added_stage_label 1/7] FROM docker.io/library/ubu 0.0s
=> CACHED [dev_container_auto_added_stage_label 2/7] RUN apt update && 0.0s
=> CACHED [dev_container_auto_added_stage_label 3/7] RUN APT-GET autorem 0.0s
=> CACHED [dev_container_auto_added_stage_label 4/7] RUN GROUPADD --gid 0.0s
=> CACHED [dev_container_auto_added_stage_label 5/7] RUN curl -C - --out 0.0s
=> ERROR [dev_container_auto_added_stage_label 6/7] RUN sdkmanager "sy 68.3s
------
> [dev_container_auto_added_stage_label 6/7] RUN sdkmanager "system-images;and
roid-33;google_apis;x86_64" && avdmanager create avd -n Android33 -k "syste
m-images;android-33;google_apis;x86_64":
#9 1.994 Loading package information...
[=======================================] 100% Unzipping... x86_64/data/misc/mod
#9 67.90 Loading local repository...
Auto-selecting single ABI x86_64========] 100% Fetch remote repository...
#9 68.21 Do you wish to create a custom hardware profile? [no] offset 0, count -
1, length 256
------
error: failed to solve: executor failed running [/bin/sh -c sdkmanager "system-i
mages;android-${ANDROID_PLATFORM_VERSION};google_apis;x86_64" && avdmanager c
reate avd -n Android${ANDROID_PLATFORM_VERSION} -k "system-images;android-${ANDR
OID_PLATFORM_VERSION};google_apis;x86_64"]: exit code: 1
[74609 ms] Error: Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f C:\Users\Ian\AppData\Local\Temp\devcontainercli\container-features\0.29.0-1675605529067\Dockerfile-with-features -t vsc-flutter-dev-container-421d5355087fab30e642f834c99e5e5b --target dev_containers_target_stage --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label d:\Work\FlutterDev\projects\flutter-dev-container\.devcontainer
[74609 ms] at pie (c:\Users\Ian\.vscode\extensions\ms-vscode-remote.remote-containers-0.275.0\dist\spec-node\devContainersSpecCLI.js:1916:1698)
[74610 ms] at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
[74610 ms] at async vF (c:\Users\Ian\.vscode\extensions\ms-vscode-remote.remote-containers-0.275.0\dist\spec-node\devContainersSpecCLI.js:1915:1972)
[74610 ms] at async P7 (c:\Users\Ian\.vscode\extensions\ms-vscode-remote.remote-containers-0.275.0\dist\spec-node\devContainersSpecCLI.js:1915:901)
[74610 ms] at async Fie (c:\Users\Ian\.vscode\extensions\ms-vscode-remote.remote-containers-0.275.0\dist\spec-node\devContainersSpecCLI.js:1921:2093)
[74610 ms] at async Vf (c:\Users\Ian\.vscode\extensions\ms-vscode-remote.remote-containers-0.275.0\dist\spec-node\devContainersSpecCLI.js:1921:3241)
[74610 ms] at async eoe (c:\Users\Ian\.vscode\extensions\ms-vscode-remote.remote-containers-0.275.0\dist\spec-node\devContainersSpecCLI.js:2045:17324)
[74610 ms] at async Qse (c:\Users\Ian\.vscode\extensions\ms-vscode-remote.remote-containers-0.275.0\dist\spec-node\devContainersSpecCLI.js:2045:17065)
[74620 ms] Exit code 1
[74624 ms] Command failed: C:\Users\Ian\AppData\Local\Programs\Microsoft VS Code\Code.exe --ms-enable-electron-run-as-node c:\Users\Ian\.vscode\extensions\ms-vscode-remote.remote-containers-0.275.0\dist\spec-node\devContainersSpecCLI.js up --user-data-folder c:\Users\Ian\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-containers\data --container-session-data-folder tmp/devcontainers-db9859e4-fbb5-4b56-a2af-cc2ff00bf4911675605524034 --workspace-folder d:\Work\FlutterDev\projects\flutter-dev-container --workspace-mount-consistency cached --id-label devcontainer.local_folder=d:\Work\FlutterDev\projects\flutter-dev-container --id-label devcontainer.config_file=d:\Work\FlutterDev\projects\flutter-dev-container\.devcontainer\devcontainer.json --log-level debug --log-format json --config d:\Work\FlutterDev\projects\flutter-dev-container\.devcontainer\devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[74624 ms] Exit code 1
Anyone have any advice please?
TIA
Cloned repo, reopened folder in containe in VS code, build

jupyterlab/hub-extension#0.12.0" is not compatible with the current JupyterLab

I want to install the littlest jupyterhub via .gitlab-ci.yml in a subdomain.
Here is my .gitlab-ci.yml. I get this error message. I need a little help to fix this error message. I know the littlest jupyterhub is still in beta.
Is it possible to add packages like pandas, mathplotlib to install with a shell script?
$ curl https://raw.githubusercontent.com/jupyterhub/the-littlest-jupyterhub/master/bootstrap/bootstrap.py | sudo python3 - --admin klein
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 2682 100 2682 0 0 24381 0 --:--:-- --:--:-- --:--:-- 24381
Checking if TLJH is already installed...
Setting up hub environment
Installed python & virtual environment
Set up hub virtual environment
Setting up TLJH installer...
Setup tljh package
Starting TLJH installer...
> /usr/bin/npm pack #jupyterlab/hub-extension
Incompatible extension:
"#jupyterlab/hub-extension#0.12.0" is not compatible with the current JupyterLab
Conflicting Dependencies:
JupyterLab Extension Package
>=0.18.3 <0.19.0 >=0.19.1 <0.20.0 #jupyterlab/application
>=0.18.3 <0.19.0 >=0.19.1 <0.20.0 #jupyterlab/apputils
Found compatible version: 0.11.0
> /usr/bin/npm pack #jupyterlab/hub-extension#0.11.0
> node /opt/tljh/user/lib/python3.6/site-packages/jupyterlab/staging/yarn.js install
> node /opt/tljh/user/lib/python3.6/site-packages/jupyterlab/staging/yarn.js run build
System has not been booted with systemd as init system (PID 1). Can't operate.
Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/opt/tljh/hub/lib/python3.6/site-packages/tljh/installer.py", line 447, in <module>
main()
File "/opt/tljh/hub/lib/python3.6/site-packages/tljh/installer.py", line 436, in main
ensure_jupyterhub_service(HUB_ENV_PREFIX)
File "/opt/tljh/hub/lib/python3.6/site-packages/tljh/installer.py", line 141, in ensure_jupyterhub_service
systemd.reload_daemon()
File "/opt/tljh/hub/lib/python3.6/site-packages/tljh/systemd.py", line 19, in reload_daemon
], check=True)
File "/usr/lib/python3.6/subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['systemctl', 'daemon-reload']' returned non-zero exit status 1.
Downloading traefik 1.6.5...
ERROR: Job failed: exit code 1
image: ubuntu:latest
before_script:
- apt-get update
- apt-get install -y curl git ssh python3 rsync sudo
- git submodule update --init --recursive
stages:
- test
- deploy
test_job:
stage: test
script:
- curl
https://raw.githubusercontent.com/jupyterhub/the-littlest-jupyterhub/master/bootstrap/bootstrap.py | sudo python3 - --admin admin
deploy:
stage: deploy
script:
- curl
https://raw.githubusercontent.com/jupyterhub/the-littlest jupyterhub/master/bootstrap/bootstrap.py | sudo python3 - --admin adminn
- mkdir .public
- cp -r * .public
- mv .public public
- mkdir "${HOME}/.ssh"
- echo "${SSH_HOST_KEY}" > "${HOME}/.ssh/known_hosts"
- echo "${SSH_PRIVATE_KEY}" > "${HOME}/.ssh/id_rsa"
- chmod 700 "${HOME}/.ssh/id_rsa"
- rsync -hrvz --delete --exclude=_ public/ user#example.com:www/jupyter/
artifacts:
paths:
- public
only:
- master

Docker compose missing yarn dependencies on build

Can't get node_modules folder when running yarn install in the Dockerfile
test-sof
├── docker-compose.yml
├── Dockerfile
├── package.json
└── yarn.lock
docker-compose.yml
version: '3'
services:
web:
build: .
volumes:
- .:/myapp
package.json
{
"name": "site",
"private": true,
"dependencies": {
"#rails/webpacker": "^3.2.1",
"babel-preset-react": "^6.24.1",
"prop-types": "^15.6.0",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"reactjs": "^1.0.0",
"underscore": "^1.8.3"
},
"devDependencies": {
"webpack-dev-server": "^2.11.1"
}
}
Dockferfile
FROM ruby:2.5
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && \
apt-get install -qq -y build-essential libpq-dev nodejs yarn
RUN mkdir /myapp
WORKDIR /myapp
ADD ./package.json /myapp/
RUN yarn install
output of the step RUN yarn install when docker-compose build:
Step 6/6 : RUN yarn install
---> Running in 3a0e7095ec81
yarn install v1.3.2
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents#1.1.3: The platform "linux" is incompatible with this module.
info "fsevents#1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "#rails/webpacker > postcss-cssnext#3.1.0" has unmet peer dependency "caniuse-lite#^1.0.30000697".
warning " > webpack-dev-server#2.11.1" has unmet peer dependency "webpack#^2.2.0 || ^3.0.0".
warning "webpack-dev-server > webpack-dev-middleware#1.12.2" has unmet peer dependency "webpack#^1.0.0 || ^2.0.0 || ^3.0.0".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 21.11s.
Removing intermediate container 3a0e7095ec81
---> 5720579a0f2a
Successfully built 5720579a0f2a
Successfully tagged testsof_web:latest
Running command: docker-compose run web bash to get in the container
root#11af1818e494:/myapp# ls
Dockerfile docker-compose.yml package.json
no node_modules folder present, but later when running inside the container: yarn install output:
root#11af1818e494:/myapp# yarn install
yarn install v1.3.2
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents#1.1.3: The platform "linux" is incompatible with this module.
info "fsevents#1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "#rails/webpacker > postcss-cssnext#3.1.0" has unmet peer dependency "caniuse-lite#^1.0.30000697".
warning " > webpack-dev-server#2.11.1" has unmet peer dependency "webpack#^2.2.0 || ^3.0.0".
warning "webpack-dev-server > webpack-dev-middleware#1.12.2" has unmet peer dependency "webpack#^1.0.0 || ^2.0.0 || ^3.0.0".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 13.03s.
then when listing:
root#11af1818e494:/myapp# ls
Dockerfile docker-compose.yml node_modules package.json yarn.lock
folder node_modules IT IS present. Why?
This part of Dockerfile installs yarn packages:
RUN mkdir /myapp
WORKDIR /myapp
ADD ./package.json /myapp/
RUN yarn install
Folder /myapp is created, package.json is copied to it and yarn packages are installed. Build is successful and, of course, node_modules folder is inside built image.
But after that you start built image with:
volumes:
- .:/myapp
which means that content of folder where docker-compose.yaml is is mounted to /myapp folder inside container, so it covers content of container's /myapp folder.
You don't need to mount current folder to container's folder to achieve what you want. Just delete it from your docker-compose.yaml:
version: '3'
services:
web:
build: .
Now you can:
$ docker-compose build
$ docker-compose run web bash
root#558d5b0c2ccb:/myapp# ls -la
total 268
drwxr-xr-x 3 root root 4096 Feb 23 22:25 .
drwxr-xr-x 65 root root 4096 Feb 23 22:36 ..
drwxr-xr-x 818 root root 36864 Feb 23 22:25 node_modules
-rw-rw-r-- 1 root root 333 Feb 23 22:07 package.json
-rw-r--r-- 1 root root 219075 Feb 23 22:25 yarn.lock
EDIT:
But what I want is when building the image, get these dependencies not
when spinning up the containers. Otherwise I have another container
which mounts de source code and needs this node_modules folder when
running the "docker-compose up" and I'd like to avoid some kind of
ugly sleep until the node_modules is finished. So I need present this
folder on my root host before up the containers somehow
If you want to achieve the above goal, you can use the following workaround:
1. You modify Dockerfile a little:
FROM ruby:2.5
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && \
apt-get install -qq -y build-essential libpq-dev nodejs yarn
RUN mkdir /build && mkdir /myapp
WORKDIR /build
ADD ./package.json /build/
RUN yarn install
WORKDIR /myapp
CMD cp -a /build/node_modules/ /myapp/
That's means that yarn packages will be built in /build folder inside image and copied to /myapp folder once container is started.
2. You use the original docker-compose.yaml file:
version: '3'
services:
web:
build: .
volumes:
- .:/myapp
when you start web container:
docker-compose up web
folder node_modules is copied to mounted folder i.e. to . folder on your host machine.
3. Now you can start any container and it will be contain node_modules folder inside /myapp:
docker-compose run web bash
So, you will be able to achieve your goal the following way:
$ docker-compose build && docker-compose up web
$ docker-compose run web bash
root#4b38e60adfa3:/myapp# ls -la
total 64
drwxrwxr-x 3 1000 1000 4096 Feb 24 10:59 .
drwxr-xr-x 66 root root 4096 Feb 24 11:13 ..
-rw-rw-r-- 1 1000 1000 497 Feb 24 10:55 Dockerfile
-rw-rw-r-- 1 1000 1000 73 Feb 24 09:02 docker-compose.yaml
drwxr-xr-x 818 root root 40960 Feb 24 10:57 node_modules
-rw-rw-r-- 1 root root 333 Feb 23 22:07 package.json

How to create a dind docker image with azure-cli on Alpine linux?

I am trying to install the azure-cli in the dind:latest image based on alpine.
For context, I want to use it to connect to AKS and deploy an app to Kubernetes via Gitlab.
In my gitlab-ci.yml file I start with this
image: docker:latest
services:
- docker:dind
and then I try to install the azure-cli
deploy-to-k8s--dev: # k8s namespace "dev"
stage: deploy-to-k8s
# image: microsoft/azure-cli
script:
# I need the azure cli in the dind:latest container
# so install bash,curl and finally the cli
- apk update
- apk upgrade
- apk add bash
- apk add --no-cache curl
- curl -L https://aka.ms/InstallAzureCli | bash
- az
and I get the following error
$ curl -L https://aka.ms/InstallAzureCli | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 167 100 167 0 0 167 0 0:00:01 --:--:-- 0:00:01 644
100 1367 100 1367 0 0 1367 0 0:00:01 --:--:-- 0:00:01 1367
mktemp: Invalid argument
ERROR: Job failed: error executing remote command: command terminated with non-zero exit code: Error executing in Docker Container: 1
It is the first time that I try to work with Alpine Linux and I have no idea how it is built and what tools it uses...
Has anyone any suggestion?
EDIT
based on the accepted answer this is the final code that works
deploy-to-k8s--dev: # k8s namespace "dev"
stage: deploy-to-k8s
script:
# I need the azure cli in the dind:latest container
# so install bash,curl and finally the cli
- apk update
- apk upgrade
- apk add bash make py-pip
- apk add --virtual=build gcc libffi-dev musl-dev openssl-dev python2-dev
- pip install azure-cli
- apk del --purge build
- az -h
This helped me in one of my alpine based image
apk update
apk add bash py-pip
apk add --virtual=build gcc libffi-dev musl-dev openssl-dev python- dev
pip install azure-cli
apk del --purge build

Error: Cannot retrieve repository metadata (repomd.xml) for repository: chromium. Please verify its path and try again

Following error occurred when I'm trying to update using "yum" command.
There's no any Internet connection issue. I just tried to get access to get solution from Error message given Red-Hat Article. but
that Red-Hat knowledge-base support for active subscribers only.
[cloudera#quickstart /]$ sudo yum update
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Update Process
Loading mirror speeds from cached hostfile
epel/metalink | 3.9 kB 00:00
* base: ftp.iitm.ac.in
* epel: mirror2.totbb.net
* extras: ftp.iitm.ac.in
* updates: ftp.iitm.ac.in
* webtatic: sp.repo.webtatic.com
http://install.linux.ncsu.edu/pub/yum/itecs/public/chromium/6/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
To address this issue please refer to the below knowledge base article
https://access.redhat.com/articles/1320623
If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: chromium. Please verify its path and try again
[cloudera#quickstart /]$
I managed to solve this issue by doing this .
[cloudera#quickstart ~]$ cd /
[cloudera#quickstart /]$ cd etc/yum.repos.d
[cloudera#quickstart yum.repos.d]$ sudo vi chromium.repo
Edit the "enabled=1" line in bellow text chunk in chromium.repo file
as "enabled=0"
[chromium]
name=chromium for RHEL Linux $releasever - $basearch - Base
baseurl=http://install.linux.ncsu.edu/pub/yum/itecs/public/chromium/$releasever/
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-chromiumpublic file:///etc/pki/rpm-gpg/RPM-GPG-KEY-chromiumpublic1 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-chromiumpublic2
[chromium-source]
name=chromium for RHEL Linux $releasever - $basearch - Source
baseurl=http://install.linux.ncsu.edu/pub/yum/itecs/public/chromium/$releasever/SRPMS
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-chromiumpublic file:///etc/pki/rpm-gpg/RPM-GPG-KEY-chromiumpublic1 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-chromiumpublic2
gpgcheck=1
Then tried the "sudo yum update all" command as following. it's now
worked for me
[cloudera#quickstart ~]$
[cloudera#quickstart ~]$ sudo yum update all
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Update Process
Loading mirror speeds from cached hostfile
epel/metalink | 3.9 kB 00:00
* base: ftp.iitm.ac.in
* epel: mirror2.totbb.net
* extras: ftp.iitm.ac.in
* updates: ftp.iitm.ac.in
* webtatic: sp.repo.webtatic.com
chromium-el6 | 1.9 kB 00:00
chromium-el6/primary_db | 17 kB 00:00
cloudera-cdh5 | 951 B 00:00
cloudera-cdh5/primary | 43 kB 00:00
cloudera-cdh5 146/146
cloudera-gplextras5 | 951 B 00:00
cloudera-gplextras5/primary | 2.4 kB 00:00
cloudera-gplextras5 9/9
cloudera-kafka | 951 B 00:00
cloudera-manager | 951 B 00:00
cloudera-manager/primary | 4.3 kB 00:00
cloudera-manager 7/7
epel | 4.3 kB 00:00
http://mirror2.totbb.net/epel/6/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
Trying other mirror.
epel | 4.3 kB 00:00
epel/primary_db | 5.9 MB 00:22
extras | 3.4 kB 00:00
extras/primary_db | 29 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 4.2 MB 00:02
webtatic | 3.6 kB 00:00
webtatic/primary_db | 208 kB 00:00
No Match for argument: all
No package all available.
No Packages marked for Update
[cloudera#quickstart ~]$