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

Images App Alpine, optimization #208

Merged
merged 3 commits into from
Feb 8, 2018
Merged

Images App Alpine, optimization #208

merged 3 commits into from
Feb 8, 2018

Conversation

andruwa13
Copy link
Contributor

No description provided.

app/Dockerfile Outdated
@@ -1,4 +1,4 @@
FROM ubuntu:16.04
FROM alpine
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to stick on a specific Alpine version. Let's go for alpine:3.6, which seems to be the latest.

app/Dockerfile Outdated

RUN apk add --no-cache \
netcat-openbsd \
Copy link
Contributor

Choose a reason for hiding this comment

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

Some maniac style comment here : can you order package list by alphabetical order and use the same indent please ? :)

app/Dockerfile Outdated
@@ -25,6 +30,7 @@ RUN mkdir -p /mattermost/data \

# Configure entrypoint and command
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

Useless entry in my opinion. We just need to set the correct permission for the file on the repository, there is no need to do it on Dockerfile I guess.

@@ -78,4 +78,4 @@ if [ "$1" = 'platform' ]; then
echo "Starting platform"
fi

exec "$@"
exec "$@"
Copy link
Contributor

Choose a reason for hiding this comment

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

Please keep newline at the end of the file :)

@pichouk
Copy link
Contributor

pichouk commented Nov 21, 2017

I really really want to use Alpine for Mattermost Docker image, but this is an important thing and we cannot decided alone.
There is an official list of supported operating systems, but Alpine is not in that list. I think we should ask Mattermost staff to discuss if they could consider to support Alpine officially and/or if it sounds ok for them to use it on our Docker image.

@jasonblais I would appreciate your opinion on this. If there is also some developers at Mattermost with an experience on Alpine, I'll like to hear from them too :)

@andruwa13
Copy link
Contributor Author

@pichouk all fix

@pichouk
Copy link
Contributor

pichouk commented Nov 21, 2017

Great, good job 👍 Thanks !

@pichouk
Copy link
Contributor

pichouk commented Nov 21, 2017

Tests failed but it seems that's because you change entrypoint.sh mode from 755 to 644.
Just chmod +x entrypoint.sh and commit the change please :)

app/Dockerfile Outdated
@@ -29,6 +29,7 @@ RUN mkdir -p /mattermost/data \

# Configure entrypoint and command
COPY entrypoint.sh /
RUN chmod 750 /entrypoint.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

No, I think we should not use this instruction on the Dockerfile. I explained myself badly I guess.
Just chmod +x entrypoint.sh inside your Git repository and commit this change :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fix

app/Dockerfile Outdated
@@ -25,6 +29,7 @@ RUN mkdir -p /mattermost/data \

# Configure entrypoint and command
COPY entrypoint.sh /
RUN chmod +x entrypoint.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here.
Should remove this line, run chmod 755 entrypoint.sh inside your repository and commit the change :)

app/Dockerfile Outdated
@@ -25,6 +29,7 @@ RUN mkdir -p /mattermost/data \

# Configure entrypoint and command
COPY entrypoint.sh /
RUN chmod 755 entrypoint.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

Still not what we should do. Access mode should be directly on the repository, not an extra-step inside the Dockerfile.
Just remove this line, apply this command on your repository chmod 755 entrypoint.sh, commit and push changes :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did not understand what to do, remove chmod 755 entrypoint.sh?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes remove this line. But it will then only work if correct mode is apply on entrypoint.sh file of the repository.
It worked like that before, but it seems you changed it in your PR. When I check at your changes I see this :
capture d ecran_2017-11-25_17-40-15
It means that you change mode for the entrypoint.sh file from 755 to 644. You just have to run the command chmod 755 entrypoint.sh inside your shell and push changes to fix this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Good 👍

@pichouk
Copy link
Contributor

pichouk commented Nov 25, 2017

TODO/reminder before merge:

@pichouk
Copy link
Contributor

pichouk commented Nov 25, 2017

Just test it on my personal server. Seems to work :)

I'll wait for @xcompass review and the Mattermost doc update. Then it is ok to merge for me.

@pichouk pichouk added Do Not Merge Should not be merged until this label is removed and removed need tests in production null labels Nov 25, 2017
@pichouk
Copy link
Contributor

pichouk commented Dec 6, 2017

I just tested it on my existing server, it seems to works perfectly ;)
EDIT: Ok so it seems that I did it 11 days ago and I didn't remember... So double check ;)

LGTM, I'll wait for @xcompass review and if this is ok, we will merge :)

@pichouk pichouk removed the Do Not Merge Should not be merged until this label is removed label Dec 6, 2017
@jasonblais
Copy link
Contributor

@pichouk Before we merge the Alpine changes, there was a proposal for one of the Mattermost members do a quick sanity test as well. We have a ticket for it here https://mattermost.atlassian.net/browse/PLT-8291

@pichouk
Copy link
Contributor

pichouk commented Dec 6, 2017

@jasonblais Good idea ! :)

app/Dockerfile Outdated
libffi-dev \
linux-headers \
netcat-openbsd \
&& rm -rf /var/cache/apk/* \
Copy link

Choose a reason for hiding this comment

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

The --no-cache flag shouldn't leave anything behind here, so I'm pretty sure this line is unnecessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ccbrown is this?
rm -rf / var / cache / apk / * \

Copy link

Choose a reason for hiding this comment

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

I'm suggesting removing that line:

RUN apk add --no-cache \
	bash \
	ca-certificates \
	curl \
	jq \
	libc6-compat \
	libffi-dev \
	linux-headers \
	netcat-openbsd \
	&& rm -rf /tmp/* 

As of Alpine Linux 3.3 there exists a new --no-cache option for apk. This avoids the need to use --update and remove /var/cache/apk/* when done installing packages.

https://github.com/gliderlabs/docker-alpine/blob/master/docs/usage.md#disabling-cache

Copy link
Contributor

@xcompass xcompass left a comment

Choose a reason for hiding this comment

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

This looks good to me.

app/Dockerfile Outdated

RUN apk add --no-cache \
bash \
Copy link
Contributor

Choose a reason for hiding this comment

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

If you use /bin/sh for the app/entrypoint.sh script then there is no need to install bash package I guess.

@pichouk
Copy link
Contributor

pichouk commented Dec 12, 2017

LGTM now.
I'm waiting for Mattermost devs to test this image.
@jasonblais I cannot comment or follow the Jira task. Can you:

  • add a link to this PR on the task. I think it will not have changes anymore, you can test.
  • ping me when the task is completed on your side

Thanks :)

@jasonblais
Copy link
Contributor

@pichouk Sure thing. I've added a link to this PR. I've also referenced the Docker Compose v3 PR #195

@pichouk
Copy link
Contributor

pichouk commented Jan 18, 2018

Please also add xmlsec1 package as requested on #225

@andruwa13
Copy link
Contributor Author

@pichouk done

@pichouk
Copy link
Contributor

pichouk commented Feb 2, 2018

Good. I'll wait for the Mattermost staff to test and validate this change.
In my side I will test again the image on my server, to validate that everything is ok. I invite everyone who can to do the same :)

Also, I'll squash all commits to get a clean git history :)

@pichouk
Copy link
Contributor

pichouk commented Feb 5, 2018

I squash the commits and test the image. Looks good to me :)
If anyone else want to test, go ahead.
@jasonblais I'll wait for validation from Mattermost team ?

@jasonblais
Copy link
Contributor

I think @coreyhulen will be testing it soon :)

Huge thanks @pichouk and everyone else involved here!

@coreyhulen
Copy link

Looks good, I've been testing it for a bit. I want to test for a little longer, but we should be gtg by tomorrow.

Unrelated to this PR, but looks like I hit the issue described at docker/for-mac#2396 since we map - /etc/localtime:/etc/localtime:ro

@coreyhulen coreyhulen self-requested a review February 6, 2018 01:32
@pichouk
Copy link
Contributor

pichouk commented Feb 6, 2018

Thanks to @andruwa13 who did the job :)

@coreyhulen It seems that there is a workaround by using an environment variable (TZ ?) instead of mounting /etc/localtime inside the container. Maybe we can use that method.

@pichouk
Copy link
Contributor

pichouk commented Feb 8, 2018

Everything looks great, I just deployed it to my production server and everything is fine. Let's merge 🎉 😄
Thanks again @andruwa13 for your job !

@pichouk pichouk merged commit efec608 into mattermost:master Feb 8, 2018
@pichouk pichouk mentioned this pull request Feb 8, 2018
@andruwa13 andruwa13 deleted the app branch February 9, 2018 13:15
TechnicLab pushed a commit to TechnicLab/mattermost-docker that referenced this pull request Feb 10, 2018
@IonCharge
Copy link

Are you including Bash in the alpine package? Or just Sh? It seems Mattermost needs/prefers bash?
Maybe worth seeing if it fixes this issue: #234

Just add the following to the dockerfile for the app:
RUN apk add --no-cache bash and change the entrypoint to be bin\bash

@pichouk

TechnicLab pushed a commit to TechnicLab/mattermost-docker that referenced this pull request Feb 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
2: Dev Review Requires review by a core committer Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants