Skip to content

Instantly share code, notes, and snippets.

@ducmeit1
Created November 23, 2019 16:34
Show Gist options
  • Save ducmeit1/7b1e6157b22cbd4cb1cb81759b68e9fa to your computer and use it in GitHub Desktop.
Save ducmeit1/7b1e6157b22cbd4cb1cb81759b68e9fa to your computer and use it in GitHub Desktop.
Dockerfile uses for build aws lambda deployment
FROM golang:1.12.13
#Install zip package to using zip
RUN DEBIAN_FRONTEND=noninteractive \
apt-get update && \
apt-get install --no-install-recommends -y \
zip
#Copy all project to src directory of default GOPATH address with name of project
COPY . /go/src/simple-go-lambda
#CD to simple-go-lambda folder by set WORKDIR
WORKDIR /go/src/simple-go-lambda
#RUN Makefile with test first, and build right after
RUN make test && make build
#We can copy the build.zip file to the root path / and chmod to 755
RUN mv build.zip / && chmod 755 /build.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment