File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Build Alpine Node.js
22permissions :
33 contents : read
4- packages : write
54
65on :
76 workflow_dispatch :
2221 - name : Build the Docker image
2322 run : |
2423 docker build --file Dockerfile --tag alpine_nodejs:${{github.event.inputs.NodeVersion}} --build-arg NodeVersion=${{github.event.inputs.NodeVersion}} --build-arg PythonVersion=${{github.event.inputs.PythonVersion}} .
25- - name : Login to GitHub Container Registry
26- uses : docker/login-action@v1
27- with :
28- registry : ghcr.io
29- username : ${{ github.actor }}
30- password : ${{ secrets.GITHUB_TOKEN }}
31- - name : Debugging with tmate
32- uses : mxschmitt/action-tmate@v3
3324 - name : Copy alpine node.js out
3425 run : |
3526 mkdir $RUNNER_TEMP/alpine_node
5546 tar xzf ./node-${{github.event.inputs.NodeVersion}}-alpine-x64.tar.gz
5647 ./bin/node -v
5748 ./bin/node -e "console.log('hello world')"
58-
59-
60-
61-
62-
63-
64-
65-
66-
67-
68-
69-
70-
71-
72-
73-
74-
Original file line number Diff line number Diff line change @@ -14,11 +14,11 @@ RUN wget https://nodejs.org/dist/$NodeVersion/node-$NodeVersion.tar.gz && tar -z
1414RUN cd node-$NodeVersion && ./configure --dest-cpu=x64 --partly-static && make -j$(getconf _NPROCESSORS_ONLN)
1515
1616# create and copy tar.gz into /node_staging
17- RUN mkdir -p /usr/src/out
17+ RUN mkdir -p /usr/src/out/bin
1818WORKDIR /usr/src/out
19- RUN cp /usr/src/app/node-$NodeVersion/out/Release/node /usr/src/out/bin
19+ RUN cp /usr/src/app/node-$NodeVersion/out/Release/node /usr/src/out/bin/node
2020RUN cp /usr/src/app/node-$NodeVersion/LICENSE /usr/src/out/LICENSE
21- RUN tar -czvf node-$NodeVersion-alpine-x64.tar.gz ./bin ./LICENSE
21+ RUN tar -czvf node-$NodeVersion-alpine-x64.tar.gz ./bin ./LICENSE && rm -rf ./bin ./LICENSE
2222RUN cp ./node-$NodeVersion-alpine-x64.tar.gz /node_staging
2323
2424# copy the tar.gz into the mapped in volume
You can’t perform that action at this time.
0 commit comments