From c00fd7be83dad02c1e07a09bfb526a3e2d67fa75 Mon Sep 17 00:00:00 2001 From: Shohei Ueda <30958501+peaceiris@users.noreply.github.com> Date: Sat, 25 Jan 2020 11:56:09 +0900 Subject: [PATCH] chore: update git (#150) * chore: rename image name * chore: add git v2.25.0 * chore: enhance Dockerfile --- .dockerignore | 7 +------ .editorconfig | 4 ++++ Dockerfile | 28 ++++++++++++++++++++++++++++ Makefile | 5 +++-- __tests__/Dockerfile | 11 ----------- 5 files changed, 36 insertions(+), 19 deletions(-) create mode 100644 Dockerfile delete mode 100644 __tests__/Dockerfile diff --git a/.dockerignore b/.dockerignore index 9b775f1..ddad3d9 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,7 +1,2 @@ .* - -!.eslintrc.json -!.prettierrc.json - -coverage -node_modules +* diff --git a/.editorconfig b/.editorconfig index 0f17867..39abb03 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,3 +7,7 @@ indent_size = 2 indent_style = space insert_final_newline = true trim_trailing_whitespace = true + +[Makefile] +indent_size = 4 +indent_style = tab diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..37f6317 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +ARG NODE_VERSION + +FROM node:${NODE_VERSION}-buster-slim + +SHELL ["/bin/bash", "-l", "-c"] + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + build-essential \ + libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev autoconf \ + ca-certificates \ + wget && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /git +ENV GIT_VERSION="2.25.0" +RUN wget -q "https://github.com/git/git/archive/v${GIT_VERSION}.tar.gz" && \ + tar -zxf "./v${GIT_VERSION}.tar.gz" && \ + rm "./v${GIT_VERSION}.tar.gz" && \ + cd "./git-${GIT_VERSION}" && \ + make configure && \ + ./configure --prefix=/usr && \ + make all && \ + make install + +WORKDIR /repo + +CMD [ "bash" ] diff --git a/Makefile b/Makefile index f28a15d..473b2e9 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ cmd := "bash" msg := "" -IMAGE_NAME := actions-hugo-dev:latest -DOCKER_BUILD := docker build . -t $(IMAGE_NAME) --file ./__tests__/Dockerfile +IMAGE_NAME := actions_hugo_dev:latest +NODE_VERSION := $(shell cat ./.nvmrc) +DOCKER_BUILD := docker build . -t $(IMAGE_NAME) --build-arg NODE_VERSION=$(NODE_VERSION) DOCKER_RUN := docker run --rm -i -t -v ${PWD}:/repo -v ~/.gitconfig:/etc/gitconfig $(IMAGE_NAME) diff --git a/__tests__/Dockerfile b/__tests__/Dockerfile deleted file mode 100644 index d9fb6b7..0000000 --- a/__tests__/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM node:12-slim - -WORKDIR /repo - -RUN apt-get update && \ - apt-get -y install --no-install-recommends \ - git \ - bash && \ - rm -rf /var/lib/apt/lists/* - -CMD [ "bash" ]