Skip to content

Commit 612be83

Browse files
authored
Merge pull request #360 from sei40kr/dockerize-snippet
Improve dockerize snippet
2 parents 388324c + cd4a428 commit 612be83

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

snippets/dockerfile-mode/alpine-dockerize

Lines changed: 0 additions & 12 deletions
This file was deleted.

snippets/dockerfile-mode/dockerize

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# -*- mode: snippet -*-
2+
# name: dockerize
3+
# key: dockerize
4+
# expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region nil))
5+
# --
6+
7+
ENV DOCKERIZE_VERSION ${1:v0.6.1}
8+
9+
`(pcase (yas-choose-value "ubuntu" "alpine")
10+
("ubuntu" (concat
11+
"RUN wget https://github.com/jwilder/dockerize/releases/download/${DOCKERIZE_VERSION}/dockerize-linux-amd64-${DOCKERIZE_VERSION}.tar.gz && \\\n"
12+
" tar -C /usr/local/bin -xzvf dockerize-linux-amd64-${DOCKERIZE_VERSION}.tar.gz && \\\n"
13+
" rm dockerize-linux-amd64-${DOCKERIZE_VERSION}.tar.gz"))
14+
("alpine" (concat
15+
"RUN apk add --no-cache openssl && \\\n"
16+
" wget https://github.com/jwilder/dockerize/releases/download/${DOCKERIZE_VERSION}/dockerize-alpine-linux-amd64-${DOCKERIZE_VERSION}.tar.gz && \\\n"
17+
" tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-${DOCKERIZE_VERSION}.tar.gz && \\\n"
18+
" rm dockerize-alpine-linux-amd64-${DOCKERIZE_VERSION}.tar.gz")))`

0 commit comments

Comments
 (0)