-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
24 lines (21 loc) · 1.05 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM alpine:3.21.0
LABEL author="Taruf Khan <https://github.com/devbyteops>"
LABEL description="Alpine based dockerfile for aliyun cli"
MAINTAINER "Taruf Khan <[email protected]>"
ARG ALIYUN_VERSION=3.0.240
RUN apk update && apk add --no-cache bash
RUN wget https://aliyuncli.alicdn.com/aliyun-cli-linux-${ALIYUN_VERSION}-amd64.tgz && \
tar -xvzf aliyun-cli-linux-${ALIYUN_VERSION}-amd64.tgz && \
rm aliyun-cli-linux-${ALIYUN_VERSION}-amd64.tgz && \
mv aliyun /usr/local/bin/
# As we are using Alpine Linux, following command will create a separate symbolic link to lib64 dynamic libraries.
RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
# Create the app user & Configure working directory
ARG USER_NAME=appuser
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN addgroup --gid $USER_GID $USER_NAME \
&& adduser -D -S -G $USER_NAME -u $USER_UID $USER_NAME \
&& mkdir /home/$USER_NAME/app && chown -R $USER_UID:$USER_GID /home/$USER_NAME/app && chmod -R 755 /home/$USER_NAME/app
WORKDIR /home/$USER_NAME/app
USER $USER_NAME