diff --git a/snippets/dockerfile-mode/alpine-dockerize b/snippets/dockerfile-mode/alpine-dockerize deleted file mode 100644 index 13a50e1..0000000 --- a/snippets/dockerfile-mode/alpine-dockerize +++ /dev/null @@ -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 diff --git a/snippets/dockerfile-mode/dockerize b/snippets/dockerfile-mode/dockerize new file mode 100644 index 0000000..3543d07 --- /dev/null +++ b/snippets/dockerfile-mode/dockerize @@ -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")))` \ No newline at end of file