Skip to content

Commit

Permalink
✨ Dockerでライセンスチェックできるように
Browse files Browse the repository at this point in the history
  • Loading branch information
Kentaro1043 committed Dec 12, 2024
1 parent 720d34d commit 65b1c98
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
7 changes: 4 additions & 3 deletions exec-container/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# hadolint ignore=DL3029
FROM --platform=amd64 nixos/nix:2.25.2

# ワークスペースの作成
RUN mkdir /workspace
# configの修正、ワークスペースの作成
RUN echo "filter-syscalls = false" >> /etc/nix/nix.conf \
&& mkdir /workspace
COPY . /workspace
WORKDIR /workspace

# ビルド成果物用の空ファイル作成
RUN touch /result \
# ビルドスクリプトの実行権限付与
&& chmod +x /workspace/build-in-docker.sh
&& chmod +x /workspace/docker/build-in-docker.sh

# ビルドキャッシュとビルド成果物
VOLUME [ "/nix/store", "/result" ]
Expand Down
2 changes: 1 addition & 1 deletion exec-container/docker/build-in-docker.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/root/.nix-profile/bin/bash

# コンテナビルド
if ! nix build --extra-experimental-features nix-command --extra-experimental-features flakes --option filter-syscalls false
if ! nix build --extra-experimental-features nix-command --extra-experimental-features flakes
then
exit 1
fi
Expand Down
5 changes: 5 additions & 0 deletions exec-container/license-check-in-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

docker build -t trao-nix .
docker volume create trao-nix_cache
docker run -v ./result:/result -v trao-nix_cache:/nix/store trao-nix /workspace/license-check.sh

0 comments on commit 65b1c98

Please sign in to comment.