Skip to content

Commit

Permalink
Update docker image build
Browse files Browse the repository at this point in the history
  • Loading branch information
williamlsh committed Feb 1, 2022
1 parent df44042 commit b186f13
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
7 changes: 1 addition & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ WORKDIR /src

COPY go.mod .

# See: https://docs.docker.com/develop/develop-images/build_enhancements/
# http://blog.oddbit.com/post/2019-02-24-docker-build-learns-about-secr/
RUN --mount=type=ssh,id=github git config --global url."git@github.com:".insteadOf "https://github.com/"; \
mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts; \
go env -w GOPRIVATE="github.com/SB-IM"; \
go mod download all; \
RUN go mod download all; \
go mod verify

COPY . .
Expand Down
6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# SSH private key set up.
CURRENT_USER ?= $(shell whoami)
PRIVATE_KEY_FILE ?= id_ed25519
PRIVATE_KEY_PATH ?= github=${HOME}/.ssh/$(PRIVATE_KEY_FILE)

# Enable docker buildkit.
DOCKER_BUILDKIT = 1
# Project image repo.
Expand Down Expand Up @@ -55,7 +50,6 @@ image:
@docker build \
--build-arg DEBUG=$(DEBUG) \
--build-arg BUILD_TAGS=$(BUILD_TAGS) \
--ssh $(PRIVATE_KEY_PATH) \
-t $(IMAGE_REPO):$(IMAGE_TAG)-$(BUILD_TAGS) \
.

Expand Down

0 comments on commit b186f13

Please sign in to comment.