Skip to content

Commit 60523d2

Browse files
committed
feat: update Dockerfile.node-aws
1 parent cf49289 commit 60523d2

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

Dockerfile.node-aws

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## +aws: Building aws-cli
22
# Even though alpine 3.18+ have native aws-cli package, the self-built package have lower size and ensure latest version.
3-
FROM python:3.11-alpine as builder
3+
FROM python:3.12-alpine as builder
44

55
RUN apk add --update-cache --no-cache \
66
unzip \
@@ -17,22 +17,21 @@ RUN wget $(wget https://api.github.com/repos/aws/aws-cli/tags\?per_page\=1 -qO-
1717

1818
RUN python -m venv venv
1919
RUN . venv/bin/activate
20-
RUN scripts/installers/make-exe
21-
RUN unzip -q dist/awscli-exe.zip
22-
RUN aws/install --bin-dir /aws-cli-bin
23-
RUN /aws-cli-bin/aws --version
20+
RUN ./configure --with-download-deps --with-install-type=portable-exe --prefix=/opt/aws-cli
21+
RUN make
22+
RUN make install
2423

2524
# reduce image size: remove autocomplete and examples
26-
RUN rm -rf /usr/local/aws-cli/v2/current/dist/aws_completer /usr/local/aws-cli/v2/current/dist/awscli/data/ac.index /usr/local/aws-cli/v2/current/dist/awscli/examples
27-
RUN find /usr/local/aws-cli/v2/current/dist/awscli/data -name completions-1*.json -delete
28-
RUN find /usr/local/aws-cli/v2/current/dist/awscli/botocore/data -name examples-1.json -delete
25+
RUN rm -rf /opt/aws-cli/bin/aws_completer /opt/aws-cli/lib/aws-cli/aws_completer /opt/aws-cli/lib/aws-cli/awscli/data/ac.index /opt/aws-cli/lib/aws-cli/awscli/examples
26+
RUN find /opt/aws-cli/lib/aws-cli/awscli/data -name completions-1*.json -delete
27+
RUN find /opt/aws-cli/lib/aws-cli/awscli/botocore/data -name examples-1.json -delete
2928
##
3029

3130

3231
FROM namesmt/images-alpine:node
3332
LABEL maintainer="[email protected]"
3433

3534
## +aws: Copy built aws-cli
36-
COPY --from=builder /usr/local/aws-cli/ /usr/local/aws-cli/
37-
COPY --from=builder /aws-cli-bin/ /usr/local/bin/
35+
COPY --from=builder /opt/aws-cli/lib/aws-cli/ /usr/local/aws-cli/
36+
RUN ln -s /usr/local/aws-cli/aws /usr/local/bin/aws
3837
##

0 commit comments

Comments
 (0)