docker build

This commit is contained in:
Brandon Thomas committed 2020-05-30 16:25:01 -04:00
1 parent a9313b0ff0
commit 7a27c2eff3
2 files changed
+57

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
name: Publish Docker image to GitHub Package Registry
on: push
jobs:
build:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' # Only on master
steps:
- name: Copy Repo Files
uses: actions/checkout@master
#This Action Emits 2 Variables, IMAGE_SHA_NAME and IMAGE_URL
#which you can reference in subsequent steps
- name: Publish Docker Image to GPR
uses: machine-learning-apps/gpr-docker-publish@master
id: docker
with:
IMAGE_NAME: 'do-spaces-downloader'
DOCKERFILE_PATH: 'Dockerfile'
BUILD_CONTEXT: '.'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+35
View File
@@ -0,0 +1,35 @@
# Unsure if I want to create minimal images yet that run under Alpine Linux.
# I have instructions for that here: https://hub.docker.com/r/echelon/testcontainer/dockerfile
FROM ubuntu:xenial as build
WORKDIR /tmp
RUN apt-get update \
&& apt-get install -y \
build-essential \
curl \
libssl-dev \
libssl1.0.0 \
pkg-config \
unzip \
wget
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
| sh -s -- --default-toolchain stable -y
COPY Cargo.lock .
COPY Cargo.toml .
COPY src/ ./src
RUN $HOME/.cargo/bin/cargo fetch
#RUN $HOME/.cargo/bin/cargo build
RUN $HOME/.cargo/bin/cargo build --release
# Final image
FROM ubuntu:xenial
WORKDIR /
#COPY --from=build /tmp/target/debug/do_spaces_downloader /
COPY --from=build /tmp/target/release/do_spaces_downloader /
COPY --from=build /lib/x86_64-linux-gnu/libssl.so.1.0.0 /lib/x86_64-linux-gnu
COPY --from=build /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /lib/x86_64-linux-gnu
CMD LD_LIBRARY_PATH=/usr/lib /do_spaces_downloader