-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
38 lines (29 loc) · 1.1 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# ARG bash_version
# FROM bash:${bash_version}
FROM ubuntu
ARG BATS_VERSION=1.4.1
ARG USER=ops
# RUN apk add --no-cache git curl \
# && git config --global user.email "[email protected]" \
# && git config --global user.name "User Name" \
# && adduser -D ${USER}
RUN apt-get update \
&& apt-get install -y git curl \
&& git config --global user.email "[email protected]" \
&& git config --global user.name "User Name" \
&& adduser ${USER}
RUN rm -f /basalt.lock
USER ops
WORKDIR /home/${USER}
# Install Basalt
RUN curl -LsSo- https://raw.githubusercontent.com/hyperupcall/basalt/main/scripts/install.sh | sh
# Install bats-core
RUN \
curl -LsSo './bats-core.tar.gz' --create-dirs "https://github.com/bats-core/bats-core/archive/v${BATS_VERSION}.tar.gz" \
&& tar xf './bats-core.tar.gz' \
&& mv ./bats-core-*/ ./bats-core \
&& rm -f './bats-core.tar.gz'
COPY --chown=$USER:$USER . ./bash-object
WORKDIR /home/$USER/bash-object
ENV PATH="/home/ops/.local/share/basalt/source/pkg/bin:$PATH"
ENTRYPOINT ["bash", "-c", "eval \"$(basalt global init bash)\" && basalt install && /home/ops/bats-core/bin/bats ./tests"]