Skip to content

Commit

Permalink
use python2 package
Browse files Browse the repository at this point in the history
  • Loading branch information
flemay committed Nov 30, 2021
1 parent a410772 commit 7dc4bfc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
FROM node:lts-alpine
ARG NODE_ALPINE_IMAGE=node:lts-alpine

FROM $NODE_ALPINE_IMAGE

# SERVERLESS_VERSION is set explicitly in the Makefile used to build, otherwise
# use latest version.
ARG SERVERLESS_VERSION=latest
ENV SERVERLESS_VERSION $SERVERLESS_VERSION

RUN apk --no-cache add python python3 python3-dev py-pip ca-certificates groff less bash make jq curl wget g++ zip git openssh && \
RUN apk --no-cache add python2 python3 python3-dev py-pip ca-certificates groff less bash make jq curl wget g++ zip git openssh && \
pip --no-cache-dir install awscli && \
update-ca-certificates

Expand Down
18 changes: 13 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
SERVERLESS_VERSION ?= $(shell docker run --rm node:alpine npm show serverless version)
NODE_ALPINE_IMAGE ?= node:lts-alpine
SERVERLESS_VERSION ?= $(shell docker run --rm $(NODE_ALPINE_IMAGE) npm show serverless version)
IMAGE_NAME ?= amaysim/serverless
IMAGE = $(IMAGE_NAME):$(SERVERLESS_VERSION)
ROOT_DIR = $(dir $(abspath $(firstword $(MAKEFILE_LIST))))

ciTest: build clean
ciDeploy: build push clean
ciTest: deps build clean
ciDeploy: deps build push clean

deps:
$(info Pull latest version of $(NODE_ALPINE_IMAGE))
docker pull $(NODE_ALPINE_IMAGE)

build: env-SERVERLESS_VERSION
docker build --build-arg SERVERLESS_VERSION=$(SERVERLESS_VERSION) -t $(IMAGE) .
docker build --no-cache \
--build-arg NODE_ALPINE_IMAGE=$(NODE_ALPINE_IMAGE) \
--build-arg SERVERLESS_VERSION=$(SERVERLESS_VERSION) \
-t $(IMAGE) .
docker run --rm $(IMAGE) bash -c 'serverless --version | grep $(SERVERLESS_VERSION)'

push: env-DOCKER_USERNAME env-DOCKER_ACCESS_TOKEN
Expand All @@ -26,4 +34,4 @@ clean:

env-%:
$(info Check if $* is not empty)
@docker run --rm -e ENV_VAR=$($*) node:alpine sh -c '[ -z "$$ENV_VAR" ] && echo "Error: $* is empty" && exit 1 || exit 0'
@docker run --rm -e ENV_VAR=$($*) $(NODE_ALPINE_IMAGE) sh -c '[ -z "$$ENV_VAR" ] && echo "Error: $* is empty" && exit 1 || exit 0'

0 comments on commit 7dc4bfc

Please sign in to comment.