Feature 11019: Workflow for cloud-native operations in OSM following Gitops model
[osm/devops.git] / docker / osm-krm-functions / Dockerfile
1 #
2 #   Licensed under the Apache License, Version 2.0 (the "License");
3 #   you may not use this file except in compliance with the License.
4 #   You may obtain a copy of the License at
5 #
6 #       http://www.apache.org/licenses/LICENSE-2.0
7 #
8 #   Unless required by applicable law or agreed to in writing, software
9 #   distributed under the License is distributed on an "AS IS" BASIS,
10 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 #   See the License for the specific language governing permissions and
12 #   limitations under the License.
13 #
14
15 FROM alpine:3.20
16 # FROM bash:3.1.23-alpine3.20
17
18 # Ensure compatibility with any script
19 RUN ln -s /usr/local/bin/bash /bin/bash
20
21 # Install packages available at Alpine repos
22 RUN apk add --no-cache \
23     age \
24     bash \
25     curl \
26     envsubst \
27     git \
28     kubectl \
29     kustomize \
30     rsync \
31     sops \
32     yq
33 #\
34 # apg \
35 # gnupg \
36 # gpg \
37 # openssh-client \
38 # sshpass
39
40 # Install other dependencies
41 RUN (curl -s https://fluxcd.io/install.sh | bash) && \
42     curl https://github.com/GoogleContainerTools/kpt/releases/download/v1.0.0-beta.44/kpt_linux_amd64 -Lo kpt && \
43     chmod +x kpt && \
44     mv kpt /usr/local/bin/
45
46 # Create new user and log in as it
47 RUN addgroup -g 10000 -S app && \
48     adduser -h /app -s /bin/false -D -u 10000 -S -G app app
49 USER app
50 WORKDIR /app
51
52 # Add helper scripts
53 COPY --chown=app:app scripts/docker-entrypoint.sh /app/scripts/entrypoint.sh
54 COPY --chown=app:app scripts/library /app/scripts/library
55
56 ENTRYPOINT [ "/app/scripts/entrypoint.sh" ]
57
58 CMD ["bash"]