| garciadeblas | 70461c5 | 2024-07-03 09:17:56 +0200 | [diff] [blame] | 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 |
| garciadeblas | 70461c5 | 2024-07-03 09:17:56 +0200 | [diff] [blame] | 16 | |
| 17 | # Ensure compatibility with any script |
| 18 | RUN ln -s /usr/local/bin/bash /bin/bash |
| 19 | |
| 20 | # Install packages available at Alpine repos |
| 21 | RUN apk add --no-cache \ |
| 22 | age \ |
| 23 | bash \ |
| 24 | curl \ |
| 25 | envsubst \ |
| 26 | git \ |
| 27 | kubectl \ |
| 28 | kustomize \ |
| 29 | rsync \ |
| 30 | sops \ |
| 31 | yq |
| garciadeblas | 70461c5 | 2024-07-03 09:17:56 +0200 | [diff] [blame] | 32 | |
| 33 | # Install other dependencies |
| 34 | RUN (curl -s https://fluxcd.io/install.sh | bash) && \ |
| 35 | curl https://github.com/GoogleContainerTools/kpt/releases/download/v1.0.0-beta.44/kpt_linux_amd64 -Lo kpt && \ |
| 36 | chmod +x kpt && \ |
| 37 | mv kpt /usr/local/bin/ |
| 38 | |
| 39 | # Create new user and log in as it |
| 40 | RUN addgroup -g 10000 -S app && \ |
| 41 | adduser -h /app -s /bin/false -D -u 10000 -S -G app app |
| 42 | USER app |
| 43 | WORKDIR /app |
| 44 | |
| 45 | # Add helper scripts |
| 46 | COPY --chown=app:app scripts/docker-entrypoint.sh /app/scripts/entrypoint.sh |
| 47 | COPY --chown=app:app scripts/library /app/scripts/library |
| 48 | |
| 49 | ENTRYPOINT [ "/app/scripts/entrypoint.sh" ] |
| 50 | |
| 51 | CMD ["bash"] |