Merge pull request #360 from sei40kr/dockerize-snippet
Improve dockerize snippet
This commit is contained in:
commit
612be838d2
2 changed files with 18 additions and 12 deletions
|
@ -1,12 +0,0 @@
|
||||||
# -*- mode: snippet -*-
|
|
||||||
# name: dockerize for Alpine Images
|
|
||||||
# key: alpine-dockerize
|
|
||||||
# expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region nil))
|
|
||||||
# --
|
|
||||||
ENV DOCKERIZE_VERSION ${1:v0.6.1}
|
|
||||||
|
|
||||||
RUN apk update && \
|
|
||||||
apk --no-cache add openssl && \
|
|
||||||
wget https://github.com/jwilder/dockerize/releases/download/\${DOCKERIZE_VERSION}/dockerize-alpine-linux-amd64-\${DOCKERIZE_VERSION}.tar.gz && \
|
|
||||||
tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-\${DOCKERIZE_VERSION}.tar.gz && \
|
|
||||||
rm dockerize-alpine-linux-amd64-\${DOCKERIZE_VERSION}.tar.gz
|
|
18
snippets/dockerfile-mode/dockerize
Normal file
18
snippets/dockerfile-mode/dockerize
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# -*- mode: snippet -*-
|
||||||
|
# name: dockerize
|
||||||
|
# key: dockerize
|
||||||
|
# expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region nil))
|
||||||
|
# --
|
||||||
|
|
||||||
|
ENV DOCKERIZE_VERSION ${1:v0.6.1}
|
||||||
|
|
||||||
|
`(pcase (yas-choose-value "ubuntu" "alpine")
|
||||||
|
("ubuntu" (concat
|
||||||
|
"RUN wget https://github.com/jwilder/dockerize/releases/download/${DOCKERIZE_VERSION}/dockerize-linux-amd64-${DOCKERIZE_VERSION}.tar.gz && \\\n"
|
||||||
|
" tar -C /usr/local/bin -xzvf dockerize-linux-amd64-${DOCKERIZE_VERSION}.tar.gz && \\\n"
|
||||||
|
" rm dockerize-linux-amd64-${DOCKERIZE_VERSION}.tar.gz"))
|
||||||
|
("alpine" (concat
|
||||||
|
"RUN apk add --no-cache openssl && \\\n"
|
||||||
|
" wget https://github.com/jwilder/dockerize/releases/download/${DOCKERIZE_VERSION}/dockerize-alpine-linux-amd64-${DOCKERIZE_VERSION}.tar.gz && \\\n"
|
||||||
|
" tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-${DOCKERIZE_VERSION}.tar.gz && \\\n"
|
||||||
|
" rm dockerize-alpine-linux-amd64-${DOCKERIZE_VERSION}.tar.gz")))`
|
Loading…
Reference in a new issue