Compare commits

..

37 Commits

Author SHA1 Message Date
836332cb75 Update .github/workflows/build.yml
All checks were successful
Build and Push Docker Image / build (push) Successful in 47s
2024-06-15 15:51:37 +00:00
dff19b33a0 Update .github/workflows/build.yml
Some checks failed
Build and Push Docker Image / build (push) Failing after 11s
2024-06-13 05:27:49 +00:00
f3aa5556ad Update .github/workflows/build.yml
Some checks failed
Build and Push Docker Image / build (push) Failing after 23s
2024-06-13 05:26:19 +00:00
b9719cbad0 Update .github/workflows/build.yml
Some checks failed
Build and Push Docker Image / build (push) Failing after 3s
2024-06-13 05:25:20 +00:00
3316304f3d Update .github/workflows/build.yml
Some checks failed
Build and Push Docker Image / build (push) Failing after 42s
2024-06-13 05:23:53 +00:00
2edc63c692 Update .github/workflows/build.yml 2024-06-13 05:21:47 +00:00
14beeea518 Update '.drone.yml'
All checks were successful
continuous-integration/drone Build is passing
2023-05-31 03:20:06 +00:00
1f3f4c5c27 Update 'Dockerfile'
Some checks failed
continuous-integration/drone Build is failing
2023-05-31 03:01:28 +00:00
8251b20d08 Update 'Dockerfile'
Some checks reported errors
continuous-integration/drone Build was killed
2023-05-31 02:43:31 +00:00
4456c275cf Update 'Dockerfile' 2023-05-31 02:43:16 +00:00
cf66e90918 Update '.drone.yml' 2023-05-31 02:42:54 +00:00
e3d9d28681 Update '.drone.yml'
Some checks failed
continuous-integration/drone Build is failing
2023-05-31 02:41:17 +00:00
6a33698b0f Update 'Dockerfile'
Some checks failed
continuous-integration/drone Build is failing
2023-05-31 02:37:31 +00:00
6e9ca7331a Update 'Dockerfile'
Some checks failed
continuous-integration/drone Build is failing
2023-05-31 02:33:01 +00:00
f32be9efaa Update 'Dockerfile'
Some checks failed
continuous-integration/drone Build is failing
2023-05-31 02:27:40 +00:00
8c37f7b192 Update '.drone.yml'
Some checks failed
continuous-integration/drone Build is failing
2023-05-31 02:21:37 +00:00
4bcc9c435b Update 'Dockerfile' 2023-05-31 02:20:29 +00:00
687afd20d3 Update 'Dockerfile'
Some checks failed
continuous-integration/drone Build is failing
2023-05-31 02:16:14 +00:00
7842eed5e7 Update '.drone.yml'
Some checks failed
continuous-integration/drone Build is failing
2023-05-31 02:11:38 +00:00
01af118af1 Update 'Dockerfile'
Some checks failed
continuous-integration/drone Build is failing
2023-05-30 23:40:36 +00:00
dd06907fba Update 'Dockerfile'
Some checks failed
continuous-integration/drone Build is failing
2023-05-30 23:27:19 +00:00
7d33e4cc28 Update 'Dockerfile'
Some checks failed
continuous-integration/drone Build is failing
2023-05-30 23:23:55 +00:00
ccc49544b2 Update '.drone.yml'
Some checks failed
continuous-integration/drone Build is failing
2023-05-30 23:17:52 +00:00
653f2d9c6d Update 'Dockerfile'
Some checks failed
continuous-integration/drone Build is failing
2023-05-30 23:02:23 +00:00
b762a59477 Update 'Dockerfile'
Some checks reported errors
continuous-integration/drone Build was killed
2023-05-30 22:51:40 +00:00
1af13b49eb Update 'Dockerfile'
Some checks reported errors
continuous-integration/drone Build was killed
2023-05-30 21:27:42 +00:00
afc7252292 Update '.drone.yml'
Some checks failed
continuous-integration/drone Build is failing
2023-02-10 05:12:53 +00:00
2f77ba4249 Update '.drone.yml'
Some checks failed
continuous-integration/drone Build is failing
2023-02-10 05:07:44 +00:00
ebaf81efbc Update '.drone.yml' 2023-02-10 04:59:28 +00:00
44f820ff24 Update 'Dockerfile'
All checks were successful
continuous-integration/drone Build is passing
2023-02-10 04:53:03 +00:00
3f1ad29bb7 Update 'Dockerfile'
Some checks failed
continuous-integration/drone Build is failing
2023-02-10 04:49:59 +00:00
6731d71795 Update '.drone.yml'
Some checks failed
continuous-integration/drone Build is failing
2023-02-10 04:42:45 +00:00
e27e029921 Update '.drone.yml'
Some checks failed
continuous-integration/drone Build is failing
2023-02-10 04:40:23 +00:00
503ddfbcc4 Add '.drone.yml'
Some checks failed
continuous-integration/drone Build is failing
2023-02-10 04:00:48 +00:00
Michael Irwin
c7bbd0119f
Merge pull request #341 from docker/speed-up-builds-with-platform-flags
Add platform flags to Dockerfile to speed up builds
2023-01-09 15:00:18 -05:00
Michael Irwin
c4e9cd0f1d
Add the setup-buildx-action and update build-push-action
Signed-off-by: Michael Irwin <mikesir87@gmail.com>
2022-12-22 15:57:09 -05:00
Michael Irwin
2981665f1f
Add BUILDPLATFORM and TARGETPLATFORM flags to speed up builds
Signed-off-by: Michael Irwin <mikesir87@gmail.com>
2022-12-22 15:52:21 -05:00
4 changed files with 71 additions and 16 deletions

15
.drone.yml Normal file
View File

@ -0,0 +1,15 @@
kind: pipeline
name: default
steps:
- name: docker
image: plugins/docker
settings:
registry: git.ericxliu.me
username: master
password: 1f8af4f82c0bd4dc24c1a03eaea6da13f54fed1c
repo: git.ericxliu.me/master/getting-started
tags: latest
platform: linux/amd64
custom_dns: [ 8.8.8.8 ]
mtu: 1450

View File

@ -1,12 +1,30 @@
name: Build name: Build and Push Docker Image
on: [push, pull_request]
on:
push:
branches:
- master
jobs: jobs:
build: build:
name: Build
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
IMAGE_NAME: ${{ github.repository_owner }}/${{ github.event.repository.name }}
DOCKER_HOST: tcp://docker.local:2375
steps: steps:
- uses: actions/checkout@v2 - name: Checkout repository
- name: Build uses: actions/checkout@v4
uses: docker/build-push-action@v1
with: with:
push: false repository: ${{ github.repository }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to the Docker registry
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login ${{ secrets.DOCKER_REGISTRY }} -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: Build the Docker image
run: docker build -t ${{ secrets.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:latest .
- name: Push the Docker image
run: docker push ${{ secrets.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:latest

View File

@ -1,11 +1,33 @@
# Install the base requirements for the app. # Install the base requirements for the app.
# This stage is to support development. # This stage is to support development.
FROM python:alpine AS base ARG BUILDPLATFORM="linux/amd64"
ARG TARGETPLATFORM="linux/amd64"
FROM --platform=$BUILDPLATFORM python:alpine AS base
WORKDIR /app WORKDIR /app
COPY requirements.txt . COPY requirements.txt .
RUN pip install -r requirements.txt
FROM node:18-alpine AS app-base RUN ping -c5 8.8.8.8
RUN ping -c5 208.67.222.222
RUN ifconfig
RUN uname -a
RUN cat /etc/resolv.conf
RUN route
RUN ip address
RUN ip route
RUN nslookup google.com
# RUN apk update
# RUN apk add --no-cache curl dig
# RUN dig https://google.com
# RUN curl -IL google.com
# RUN curl ifconfig.me
RUN pip3 install --default-timeout=100 -r requirements.txt
FROM --platform=$BUILDPLATFORM node:18-alpine AS app-base
WORKDIR /app WORKDIR /app
COPY app/package.json app/yarn.lock ./ COPY app/package.json app/yarn.lock ./
COPY app/spec ./spec COPY app/spec ./spec
@ -25,16 +47,16 @@ RUN apk add zip && \
zip -r /app.zip /app zip -r /app.zip /app
# Dev-ready container - actual files will be mounted in # Dev-ready container - actual files will be mounted in
FROM base AS dev FROM --platform=$BUILDPLATFORM base AS dev
CMD ["mkdocs", "serve", "-a", "0.0.0.0:8000"] CMD ["mkdocs", "serve", "-a", "0.0.0.0:8000"]
# Do the actual build of the mkdocs site # Do the actual build of the mkdocs site
FROM base AS build FROM --platform=$BUILDPLATFORM base AS build
COPY . . COPY . .
RUN mkdocs build RUN mkdocs build
# Extract the static content from the build # Extract the static content from the build
# and use a nginx image to serve the content # and use a nginx image to serve the content
FROM nginx:alpine FROM --platform=$TARGETPLATFORM nginx:alpine
COPY --from=app-zip-creator /app.zip /usr/share/nginx/html/assets/app.zip COPY --from=app-zip-creator /app.zip /usr/share/nginx/html/assets/app.zip
COPY --from=build /app/site /usr/share/nginx/html COPY --from=build /app/site /usr/share/nginx/html

View File

@ -2162,9 +2162,9 @@ json-parse-even-better-errors@^2.3.0:
integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==
json5@^2.2.1: json5@^2.2.1:
version "2.2.3" version "2.2.1"
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c"
integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==
kleur@^3.0.3: kleur@^3.0.3:
version "3.0.3" version "3.0.3"