Skip to content

Commit 9678182

Browse files
committed
First push
0 parents  commit 9678182

File tree

6 files changed

+92
-0
lines changed

6 files changed

+92
-0
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
image.id
2+
*.code-workspace
3+
.gitignore
4+
.gcloudignore
5+
*.flag

.gcloudignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
README.md
2+
localbuild.sh
3+

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
image.id
2+
cloudbuild*
3+
*.flag
4+
*.code-workspace

Dockerfile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#
2+
# debian-awscli is a lightweight base image that has bash, python3 and the AWS CLI on board (for S3 access)
3+
#
4+
# We switched from Alpine to Debian for this image due to these two articles:
5+
# - https://pythonspeed.com/articles/base-image-python-docker-images/
6+
# - https://pythonspeed.com/articles/alpine-docker-python/
7+
#
8+
# TODO: Make this a multi-stage dockerfile, we don't need the full C compiler and all that in the base image!
9+
#
10+
FROM python:3.8-slim-buster
11+
12+
ENV AWSCLI_VERSION="1.18.56"
13+
14+
ENV PATH="/app/.local/bin:${PATH}"
15+
16+
#
17+
# This hack is widely applied to avoid python printing issues in docker containers.
18+
# See: https://github.com/Docker-Hub-frolvlad/docker-alpine-python3/pull/13
19+
#
20+
ENV PYTHONUNBUFFERED=1
21+
22+
#
23+
# The two lines below are there to prevent a red line error to be shown about apt-utils not being installed
24+
#
25+
ARG DEBIAN_FRONTEND=noninteractive
26+
SHELL ["/bin/bash", "-c"]
27+
28+
29+
RUN \
30+
whoami && \
31+
apt-get update && \
32+
apt-get install -y --no-install-recommends apt-utils 2> >( grep -v 'since apt-utils is not installed' >&2 ) && \
33+
apt-get install -y -qq less groff ca-certificates wget curl jq git rsync && \
34+
pip install --upgrade pip && \
35+
pip install awscli==$AWSCLI_VERSION && \
36+
pip install rdflib && \
37+
pip install git+https://github.com/rdflib/sparqlwrapper#egg=sparqlwrapper && \
38+
pip install requests && \
39+
pip install boto3 && \
40+
pip install pystardog && \
41+
apt-get autoremove --purge -y git && \
42+
apt-get clean -y && \
43+
rm -rf /app/.cache >/dev/null 2>&1 || true && \
44+
mkdir -p /app/.aws
45+
46+
WORKDIR /app/
47+
48+
ENTRYPOINT [ "/usr/local/bin/aws" ]

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Base Image - debian-awscli
2+
3+
debian-awscli is a lightweight base image that has bash, python and the AWS CLI on board (for S3 access)
4+
5+
We switched from Alpine to Debian for this image due to these two articles:
6+
- https://pythonspeed.com/articles/base-image-python-docker-images/
7+
- https://pythonspeed.com/articles/alpine-docker-python/
8+
9+
Utilities in this image:
10+
11+
- jq (for processing JSON)
12+
- curl & wget (for executing HTTP commands)
13+
- git
14+
- rsync
15+
16+
Python libraries:
17+
18+
- awscli
19+
- rdflib
20+
- pystardog
21+
- requests
22+
- boto3

localbuild.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
_IMAGE_NAME="ekgf/debian-awscli"
3+
_IMAGE_VERSION="latest"
4+
_MANUALLY_INCREMENTED_IMAGE_VERSION="0.0.1"
5+
6+
docker build . \
7+
--iidfile=image.id \
8+
"--tag=${_IMAGE_NAME}:${_IMAGE_VERSION}" \
9+
"--tag=${_IMAGE_NAME}:${_MANUALLY_INCREMENTED_IMAGE_VERSION}"
10+
exit $?

0 commit comments

Comments
 (0)