Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Commit

Permalink
introduce ARG for the Dockerfile in order to represent version of uniq2
Browse files Browse the repository at this point in the history
  • Loading branch information
tamada committed Mar 10, 2020
1 parent a4dbe89 commit 9b9705c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
FROM alpine:3.10.1
ARG version="1.0.3"
LABEL maintainer="Haruai Tamada" \
uniq2-version="1.0.2" \
description="Deleting duplicate lines"

RUN adduser -D uniq2 \
&& apk --no-cache add curl=7.66.0-r0 tar=1.32-r0 \
&& curl -s -L -O https://github.com/tamada/uniq2/releases/download/v1.0.2/uniq2-1.0.2_linux_amd64.tar.gz \
&& tar xfz uniq2-1.0.2_linux_amd64.tar.gz \
&& mv uniq2-1.0.2 /opt \
&& ln -s /opt/uniq2-1.0.2 /opt/uniq2 \
&& curl -s -L -O https://github.com/tamada/uniq2/releases/download/v${version}/uniq2-${version}_linux_amd64.tar.gz \
&& tar xfz uniq2-${version}_linux_amd64.tar.gz \
&& mv uniq2-${version} /opt \
&& ln -s /opt/uniq2-${version} /opt/uniq2 \
&& ln -s /opt/uniq2/uniq2 /usr/local/bin/uniq2 \
&& rm uniq2-1.0.2_linux_amd64.tar.gz
&& rm uniq2-${version}_linux_amd64.tar.gz

ENV HOME="home/uniq2"

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ update_version:
@for i in README.md docs/content/_index.md; do\
sed -e 's!Version-[0-9.]*-yellowgreen!Version-${VERSION}-yellowgreen!g' -e 's!tag/v[0-9.]*!tag/v${VERSION}!g' $$i > a ; mv a $$i; \
done
@sed 's/const VERSION = .*/const VERSION = "${VERSION}"/g' cmd/uniq2/main.go > a
@mv a cmd/uniq2/main.go
@sed 's/const VERSION = .*/const VERSION = "${VERSION}"/g' cmd/uniq2/main.go > a; mv a cmd/uniq2/main.go
@sed 's/ARG version=".*"/ARG version="${VERSION}"/g' Dockerfile > a ; mv a Dockerfile
@echo "Replace version to \"${VERSION}\""

test: setup
Expand Down

0 comments on commit 9b9705c

Please sign in to comment.