-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build epicli image using Dockerfile only (#1614)
- Loading branch information
Showing
8 changed files
with
94 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
# Ignore all unwanted files from the docker build process | ||
|
||
.git | ||
.git* | ||
*.log | ||
certs/ | ||
**/data/* | ||
|
||
*.md | ||
|
||
tests/ | ||
Dockerfile | ||
|
||
core/data/ | ||
core/build/ | ||
# Exclude unnecessary files from the build context | ||
# This file is meant to be used as a whitelist | ||
|
||
# Exclude everything | ||
* | ||
|
||
# Include the following | ||
!README.md | ||
!LICENSE | ||
!core/src/epicli/.devcontainer/requirements.txt | ||
!core/src/epicli/cli/ | ||
!core/src/epicli/data/ | ||
!core/src/epicli/setup.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# === Build epicli wheel file === | ||
|
||
FROM python:3.7-slim AS build-epicli-wheel | ||
|
||
COPY . /src | ||
WORKDIR /src/core/src/epicli | ||
|
||
RUN python setup.py bdist_wheel | ||
|
||
# === Build final image === | ||
|
||
FROM python:3.7-slim | ||
|
||
ARG USERNAME=epiuser | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
|
||
ENV EPICLI_DOCKER_SHARED_DIR=/shared | ||
|
||
COPY --from=build-epicli-wheel /src/core/src/epicli/dist/ /epicli/ | ||
|
||
RUN apt-get update \ | ||
&& apt-get install --no-install-recommends -y \ | ||
gcc libffi-dev make musl-dev openssh-client ruby-full sudo tar unzip vim \ | ||
&& gem install \ | ||
rake rspec_junit_formatter serverspec \ | ||
&& pip install --disable-pip-version-check --no-cache-dir \ | ||
/epicli/epicli-*-py3-none-any.whl \ | ||
\ | ||
&& apt-get autoremove -y \ | ||
&& apt-get clean -y \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
\ | ||
&& groupadd --gid $USER_GID $USERNAME \ | ||
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \ | ||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ | ||
&& chmod 0440 /etc/sudoers.d/$USERNAME \ | ||
\ | ||
&& mkdir -p $EPICLI_DOCKER_SHARED_DIR \ | ||
&& chown $USERNAME $EPICLI_DOCKER_SHARED_DIR \ | ||
&& chmod g+w $EPICLI_DOCKER_SHARED_DIR | ||
|
||
WORKDIR $EPICLI_DOCKER_SHARED_DIR | ||
|
||
USER $USERNAME | ||
|
||
ENTRYPOINT ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters