Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

Build everything with docker-compose #104

Merged
merged 3 commits into from
Aug 5, 2020

Conversation

sladyn98
Copy link
Contributor

@sladyn98 sladyn98 commented Aug 1, 2020

This PR deals with creating the backend without relying on local tools.This has some errors with docker compose which need to be fixed before merging

@sladyn98 sladyn98 requested a review from a team as a code owner August 1, 2020 08:53
@martinda
Copy link
Contributor

martinda commented Aug 1, 2020

When I checkout this PR, I get:

$ docker-compose up -d --build
Building app-server
Step 1/10 : FROM maven:3.5.2-jdk-8-alpine AS MAVEN_BUILD
3.5.2-jdk-8-alpine: Pulling from library/maven
cfc728c1c558: Pull complete
5b12b87f0a0e: Pull complete
b7d6497a92f9: Pull complete
399bf9752347: Pull complete
9e41e7b89fb8: Pull complete
1017f315d511: Pull complete
22bc7fb81913: Pull complete
Digest: sha256:7cebda60f8a541e1bf2330306d22f9786f989187f4ec96539d398a0d4dbfdadb
Status: Downloaded newer image for maven:3.5.2-jdk-8-alpine
 ---> 293423a981a7
Step 2/10 : LABEL maintainer="sladynnunes98@gmail.com"
 ---> Running in 93467273154c
Removing intermediate container 93467273154c
 ---> cc786b81b93e
Step 3/10 : COPY pom.xml /build/
ERROR: Service 'app-server' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder778765520/pom.xml: no such file or directory

@sladyn98
Copy link
Contributor Author

sladyn98 commented Aug 3, 2020

@martinda Yeah That is the error I am talking about in the description. It cannot find the file to copy even though it should be able to copy everything. One of the reasons is the dockerignore, it is not allowing anything to be copied

@martinda
Copy link
Contributor

martinda commented Aug 3, 2020

Then the .dockerignore needs to be fixed to allow files to go to the context of what the docker images do need to copy. For example, to reveal the pom.xml adding this line to the .dockerignore` works:

!**/pom.xml

@martinda
Copy link
Contributor

martinda commented Aug 3, 2020

What is the goal at the end of this PR? Is it to run just docker commands and no maven commands?

@sladyn98
Copy link
Contributor Author

sladyn98 commented Aug 3, 2020

@martinda Yes the goal is to be able to run without maven because every user might not have maven installed

@sladyn98
Copy link
Contributor Author

sladyn98 commented Aug 3, 2020

@martinda updated docker ignore

@martinda martinda changed the title Modified backend dockerfile Ability to build everything with Docker Aug 3, 2020
@martinda martinda changed the title Ability to build everything with Docker Build everything with docker-compose Aug 3, 2020
@kwhetstone
Copy link
Contributor

This should include changes to the readme to run the commands as well.

@sladyn98
Copy link
Contributor Author

sladyn98 commented Aug 4, 2020

This works fine for me and the readme is perfect. No additional commands required

Copy link
Contributor

@martinda martinda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It work for me too. I think this is very good. No need to locally build, it builds itself in images.

I am not an expert in docker image and container management, maybe the infra team will have feedback on how to manage this in the future. For now I think we can accept this PR.

.dockerignore Outdated Show resolved Hide resolved
@sladyn98 sladyn98 merged commit 7dc2dc8 into jenkinsci:master Aug 5, 2020
sladyn98 pushed a commit to sladyn98/custom-distribution-service that referenced this pull request Aug 9, 2020
* Modified backend dockerfile

* Update .dockerignore

* Made dockerfile changes
sladyn98 pushed a commit to sladyn98/custom-distribution-service that referenced this pull request Aug 9, 2020
* Modified backend dockerfile

* Update .dockerignore

* Made dockerfile changes
@sladyn98 sladyn98 added the feature A PR that adds a feature label Aug 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature A PR that adds a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants