Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Amazon Linux 2 builder image #7

Merged
merged 1 commit into from
Aug 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.dockerignore
Dockerfile
Dockerfile.al
Dockerfile.al2
Makefile
README.md
File renamed without changes.
17 changes: 17 additions & 0 deletions Dockerfile.al2
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Build image for building with Rust on Amazon Linux 2, suitable for custom AWS Lambda runtimes.

FROM amazonlinux:2.0.20200722.0
LABEL maintainer="Kit Ewbank <Kit_Ewbank@hotmail.com>"

ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
RUST_VERSION=1.45.2

RUN curl https://sh.rustup.rs -sSf | sh -s -- --no-modify-path --profile minimal --default-toolchain $RUST_VERSION -y; \
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
rustup --version; \
cargo --version; \
rustc --version;

WORKDIR /volume
28 changes: 19 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
LOCAL=rust:1.45.0-amazonlinux2018.03.0.20200602.1
REMOTE=ewbankkit/rust-amazonlinux:1.45.0-2018.03.0.20200602.1
LOCAL_AL=rust:1.45.0-amazonlinux2018.03.0.20200602.1
REMOTE_AL=ewbankkit/rust-amazonlinux:1.45.0-2018.03.0.20200602.1
LOCAL_AL2=rust:1.45.2-amazonlinux2.0.20200722.0
REMOTE_AL2=ewbankkit/rust-amazonlinux:1.45.2-2.0.20200722.0

.PHONY: all image push
.PHONY: all image_al push_al image_al2 push_al2

all: push
all: push_al push_al2

image:
docker build --file Dockerfile --tag ${LOCAL} .
docker tag ${LOCAL} ${REMOTE}
image_al:
docker build --file Dockerfile.al --tag ${LOCAL_AL} .
docker tag ${LOCAL_AL} ${REMOTE_AL}

# Don't forget to docker login.
push: image
docker push ${REMOTE}
push_al: image_al
docker push ${REMOTE_AL}

image_al2:
docker build --file Dockerfile.al2 --tag ${LOCAL_AL2} .
docker tag ${LOCAL_AL2} ${REMOTE_AL2}

# Don't forget to docker login.
push_al2: image_al2
docker push ${REMOTE_AL2}
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@
This is the Git repo of the Docker images for building with Rust on Amazon Linux.

See [the Docker Hub page](https://hub.docker.com/r/ewbankkit/rust-amazonlinux) for the full readme on how to use this Docker image.

Both Amazon Linux and Amazon Linux 2-based images can be created.

### Creating and Publishing Images

```console
$ make
```