-
Notifications
You must be signed in to change notification settings - Fork 0
Dev docker wrapper #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
3affc5b
ab75c70
d6579ab
5891bd9
5a03335
25a6ea5
5b3db23
73fe766
19062e1
41b12f2
60235f2
2cfef32
524b980
bd817a8
d3dba73
55a67a0
5803677
f9a861b
83504e7
115beec
469abf1
7a68af3
a0cf44a
0eb014c
e6f3769
a7877f7
479cacc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
vendor/ | ||
.git/ | ||
.vscode/ | ||
.idea/ | ||
hooks | ||
Dockerfile |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
## | ||
# Composer | ||
## | ||
FROM composer:latest as composer | ||
|
||
## | ||
# PHP Builder | ||
## | ||
FROM php:7.4-cli as build | ||
|
||
ARG DOCKER_TAG | ||
|
||
# Deps | ||
RUN apt-get update && apt-get install -y \ | ||
unzip \ | ||
git | ||
|
||
# Grab composer | ||
COPY --from=composer /usr/bin/composer /usr/bin/composer | ||
|
||
COPY . /app | ||
WORKDIR /app | ||
|
||
# Install CLI deps | ||
RUN composer install --ansi --no-interaction --no-progress --prefer-dist | ||
|
||
# Build the phar | ||
RUN php netsells app:build --build-version=$DOCKER_TAG | ||
|
||
## | ||
# PHP Runtime | ||
## | ||
FROM php:7.4-cli as runtime | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can do few tweaks here to make the resulting image considerably smaller, and also to make the self-update pull down only the things that changed. Are you ok for me to look into it later on in the evening? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Absolutely mate - I was doing this between meetings so it's very WIP - just wanted it in front of you as I knew you'd spot a load of improvements There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great, will try few ideas and report back :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've done few tweaks to reduce the image by > 300MB. It's still big, but at least it has all tools inside it which is convenient. ECR helper works well after a fix which is great, however worth testing again on TeamCity, as it won't have access to the AWS config file I think? I do have problems using the SSM connect feature, but not sure if it's just all our EC2 instances not having it enabled or something? Would be nice if you can confirm it's working. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great work - yeah the NS EC2 images aren't setup for SSM There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I already checked on the YPS Teamcity agent, it's able to access the meta domain so is able to get auth 🌮 |
||
|
||
# Deps | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
unzip git openssh-client && \ | ||
apt-get purge -y autoconf pkg-config gcc && \ | ||
apt-get autoremove -y && \ | ||
apt-get autoclean && \ | ||
apt-get clean && \ | ||
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" \ | ||
-o /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose && \ | ||
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" \ | ||
-o "awscliv2.zip" && unzip -q awscliv2.zip && ./aws/install && rm awscliv2.zip && rm -rf ./aws && \ | ||
curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_64bit/session-manager-plugin.deb" \ | ||
-o "session-manager-plugin.deb" && dpkg -i session-manager-plugin.deb && rm session-manager-plugin.deb && \ | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
# Grab docker client from existing docker image | ||
COPY --from=docker:20-dind /usr/local/bin/docker /usr/local/bin/docker | ||
|
||
# Copy the wrapper from source | ||
COPY ./docker-support/netsells /usr/local/bin/netsells-wrapper | ||
|
||
# Grab built phar from the builder | ||
COPY --from=build /app/builds/netsells /usr/local/bin/netsells | ||
|
||
ENV AWS_SDK_LOAD_CONFIG 1 | ||
|
||
RUN mkdir /app | ||
WORKDIR /app | ||
|
||
ENTRYPOINT ["netsells"] |
Uh oh!
There was an error while loading. Please reload this page.