-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
58 lines (48 loc) · 1.62 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# =============================================================================
# QiiCipher for Docker
# =============================================================================
# QiiCipher のコマンドだけを含めた Alpine イメージです。
# マルチステージ・ビルドでテストを実行し、最終的に QiiCipher のコマンドだけを含めたシンプル
# なイメージを作成します。
#
# ビルド例
# $ docker build -t qiic .
# 実行例
# $ docker run --rm -it qiic /bin/sh
# -----------------------------------------------------------------------------
# Test Stage
# -----------------------------------------------------------------------------
FROM alpine:latest AS testbuild
# Install miminum requirements for QiiCipher
RUN apk add --no-cache \
openssl \
openssh \
coreutils \
ca-certificates && update-ca-certificates
# Install requirements for testing
RUN apk add --no-cache \
curl \
git \
shellcheck \
shfmt \
&& curl -fsSL https://git.io/shellspec | sh -s -- --yes --prefix /usr/local
# Copy the hole repo
COPY . /app
WORKDIR /app
# Run tests
RUN \
/app/.github/run-lint.sh \
&& /app/.github/run-test.sh
# -----------------------------------------------------------------------------
# Final Stage
# -----------------------------------------------------------------------------
FROM alpine
# Install miminum requirements for QiiCipher
RUN apk add --no-cache \
openssl \
openssh \
coreutils \
ca-certificates && update-ca-certificates
COPY --from=testbuild /app/bin /usr/local/sbin
WORKDIR /app
CMD ["/bin/ls","/usr/local/sbin"]