Reuse working directory files in uD3TN Dockerfile and add dockerignore

Signed-off-by: Georg Alexander Murzik <georg.murzik@d3tn.com>
This commit is contained in:
Georg Alexander Murzik 2021-01-12 12:11:27 +01:00
parent ee7eb9c069
commit 7da67b5f25
4 changed files with 66 additions and 13 deletions

54
.dockerignore Normal file
View file

@ -0,0 +1,54 @@
# Git
**/.git
# Local configuration files
config.mk
# Files and directories generated by the build process
build
**/*.o
**/*.a
**/*.out
# Generation of Compile Commands
**/*.ccmd
**/*.ccmds
compile_commands.json
# Files generated by other automated tools and logfiles
callgrind.out.*
cicache
citemp
.venv
.pytest_cache
**/__pycache__
# Project files of common IDEs
*.config
*.files
*.includes
# QtCreator
*.creator
*.user*
# KDevelop
*.kdev4
**/.kdev4
# JetBrains IDEs
**/.idea
# CMake + CMake-based IDEs
CMakeLists.txt
cmake-build-*
# Atom Text Editor
.atomignore
*.cson
# Misc temporary and platform-specific files
**/~*
**/*~
**/*.swp
**/*.log
**/*.plist
**/*.envrc
**/.directory
# uD3TN Socket
*.socket

View file

@ -225,4 +225,4 @@ publish-docker-image:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$UD3TN_CI_DOCKER_DEPLOY_USER\",\"password\":\"$UD3TN_CI_DOCKER_DEPLOY_PASSWORD\"}}}" > /kaniko/.docker/config.json
# Build and push the docker image
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --build-arg UD3TN_VERSION=$CI_COMMIT_TAG $IMAGES
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/dockerfiles/ud3tn --build-arg UD3TN_VERSION=$CI_COMMIT_TAG $IMAGES

View file

@ -1,12 +0,0 @@
FROM alpine
ARG UD3TN_VERSION
RUN apk add git make gcc libc-dev
RUN git clone --recursive --depth=1 --branch $UD3TN_VERSION https://gitlab.com/d3tn/ud3tn.git
RUN cd ud3tn && make posix
FROM alpine
RUN apk add coreutils
COPY --from=0 /ud3tn/build/posix/ud3tn /ud3tn
ENTRYPOINT [ "stdbuf", "-oL", "/ud3tn" ]

11
dockerfiles/ud3tn Normal file
View file

@ -0,0 +1,11 @@
FROM alpine
RUN apk update
RUN apk add make gcc libc-dev
ADD . /ud3tn/
RUN cd /ud3tn && make posix
FROM alpine
RUN apk update
RUN apk add coreutils
COPY --from=0 /ud3tn/build/posix/ud3tn /ud3tn
ENTRYPOINT [ "stdbuf", "-oL", "/ud3tn" ]