Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from lucor/docker-images-refactoring
Docker images refactoring
- Loading branch information
Showing
33 changed files
with
637 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
/fyne-cross | ||
/*.dmg | ||
/*.xip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,83 @@ | ||
tag := $(shell date +"%y.%m.%d") | ||
|
||
build-images: | ||
@docker build -f ${CURDIR}/docker/base/Dockerfile -t fyneio/fyne-cross:base-latest . | ||
@docker tag fyneio/fyne-cross:base-latest fyneio/fyne-cross:base-$(tag) | ||
@docker build -f ${CURDIR}/docker/linux-386/Dockerfile -t fyneio/fyne-cross:linux-386-latest . | ||
@docker tag fyneio/fyne-cross:linux-386-latest fyneio/fyne-cross:linux-386-$(tag) | ||
@docker build -f ${CURDIR}/docker/linux-arm/Dockerfile -t fyneio/fyne-cross:linux-arm-latest . | ||
@docker tag fyneio/fyne-cross:linux-arm-latest fyneio/fyne-cross:linux-arm-$(tag) | ||
@docker build -f ${CURDIR}/docker/linux-arm64/Dockerfile -t fyneio/fyne-cross:linux-arm64-latest . | ||
@docker tag fyneio/fyne-cross:linux-arm64-latest fyneio/fyne-cross:linux-arm64-$(tag) | ||
@docker build -f ${CURDIR}/docker/android/Dockerfile -t fyneio/fyne-cross:android-latest . | ||
@docker tag fyneio/fyne-cross:android-latest fyneio/fyne-cross:android-$(tag) | ||
@docker build -f ${CURDIR}/docker/freebsd/Dockerfile -t fyneio/fyne-cross:freebsd-latest . | ||
@docker tag fyneio/fyne-cross:freebsd-latest fyneio/fyne-cross:freebsd-$(tag) | ||
|
||
push-images: | ||
$(eval TAG := $(date +"%y.%m.%d")) | ||
@docker push fyneio/fyne-cross:base-latest | ||
@docker push fyneio/fyne-cross:base-$(tag) | ||
@docker push fyneio/fyne-cross:linux-386-latest | ||
@docker push fyneio/fyne-cross:linux-386-$(tag) | ||
@docker push fyneio/fyne-cross:linux-arm-latest | ||
@docker push fyneio/fyne-cross:linux-arm-$(tag) | ||
@docker push fyneio/fyne-cross:linux-arm64-latest | ||
@docker push fyneio/fyne-cross:linux-arm64-$(tag) | ||
@docker push fyneio/fyne-cross:android-latest | ||
@docker push fyneio/fyne-cross:android-$(tag) | ||
@docker push fyneio/fyne-cross:freebsd-latest | ||
@docker push fyneio/fyne-cross:freebsd-$(tag) | ||
FYNE_CROSS_VERSION := "1.1" | ||
|
||
base: | ||
@docker build -f ${CURDIR}/docker/base/Dockerfile -t fyneio/fyne-cross:${FYNE_CROSS_VERSION}-base . | ||
|
||
base-llvm: base | ||
@docker build --build-arg FYNE_CROSS_VERSION=${FYNE_CROSS_VERSION} -f ${CURDIR}/docker/base-llvm/Dockerfile -t fyneio/fyne-cross:${FYNE_CROSS_VERSION}-base-llvm . | ||
|
||
android: base | ||
@docker build --build-arg FYNE_CROSS_VERSION=${FYNE_CROSS_VERSION} -f ${CURDIR}/docker/android/Dockerfile -t fyneio/fyne-cross:${FYNE_CROSS_VERSION}-android . | ||
|
||
darwin: base-llvm | ||
@docker build --build-arg FYNE_CROSS_VERSION=${FYNE_CROSS_VERSION} -f ${CURDIR}/docker/darwin/Dockerfile -t fyneio/fyne-cross:${FYNE_CROSS_VERSION}-darwin . | ||
|
||
base-freebsd: base-llvm | ||
@docker build --build-arg FYNE_CROSS_VERSION=${FYNE_CROSS_VERSION} -f ${CURDIR}/docker/base-freebsd/Dockerfile -t fyneio/fyne-cross:${FYNE_CROSS_VERSION}-base-freebsd . | ||
|
||
freebsd: base-freebsd | ||
@docker build --build-arg FYNE_CROSS_VERSION=${FYNE_CROSS_VERSION} -f ${CURDIR}/docker/freebsd-amd64/Dockerfile -t fyneio/fyne-cross:${FYNE_CROSS_VERSION}-freebsd-amd64 . | ||
@docker build --build-arg FYNE_CROSS_VERSION=${FYNE_CROSS_VERSION} -f ${CURDIR}/docker/freebsd-arm64/Dockerfile -t fyneio/fyne-cross:${FYNE_CROSS_VERSION}-freebsd-arm64 . | ||
|
||
linux: base | ||
@docker build --build-arg FYNE_CROSS_VERSION=${FYNE_CROSS_VERSION} -f ${CURDIR}/docker/linux-386/Dockerfile -t fyneio/fyne-cross:${FYNE_CROSS_VERSION}-linux-386 . | ||
@docker build --build-arg FYNE_CROSS_VERSION=${FYNE_CROSS_VERSION} -f ${CURDIR}/docker/linux-arm/Dockerfile -t fyneio/fyne-cross:${FYNE_CROSS_VERSION}-linux-arm . | ||
@docker build --build-arg FYNE_CROSS_VERSION=${FYNE_CROSS_VERSION} -f ${CURDIR}/docker/linux-arm64/Dockerfile -t fyneio/fyne-cross:${FYNE_CROSS_VERSION}-linux-arm64 . | ||
|
||
windows: base | ||
@docker build --build-arg FYNE_CROSS_VERSION=${FYNE_CROSS_VERSION} -f ${CURDIR}/docker/windows/Dockerfile -t fyneio/fyne-cross:${FYNE_CROSS_VERSION}-windows . | ||
|
||
# build all images for release. Note do not build darwin | ||
build-images: base android freebsd linux windows | ||
|
||
# tag the images with the YY.MM.DD suffix | ||
tag-images: | ||
# tag base images | ||
@docker tag fyneio/fyne-cross:${FYNE_CROSS_VERSION}-base fyneio/fyne-cross:${FYNE_CROSS_VERSION}-base-$(tag) | ||
@docker tag fyneio/fyne-cross:${FYNE_CROSS_VERSION}-base-llvm fyneio/fyne-cross:${FYNE_CROSS_VERSION}-base-llmv-$(tag) | ||
@docker tag fyneio/fyne-cross:${FYNE_CROSS_VERSION}-base-freebsd fyneio/fyne-cross:${FYNE_CROSS_VERSION}-base-freebsd-$(tag) | ||
# tag android images | ||
@docker tag fyneio/fyne-cross:${FYNE_CROSS_VERSION}-android fyneio/fyne-cross:${FYNE_CROSS_VERSION}-android-$(tag) | ||
# tag linux images | ||
@docker tag fyneio/fyne-cross:${FYNE_CROSS_VERSION}-linux-386 fyneio/fyne-cross:${FYNE_CROSS_VERSION}-linux-386-$(tag) | ||
@docker tag fyneio/fyne-cross:${FYNE_CROSS_VERSION}-linux-arm fyneio/fyne-cross:${FYNE_CROSS_VERSION}-linux-arm-$(tag) | ||
@docker tag fyneio/fyne-cross:${FYNE_CROSS_VERSION}-linux-arm64 fyneio/fyne-cross:${FYNE_CROSS_VERSION}-linux-arm64-$(tag) | ||
# tag freebsd images | ||
@docker tag fyneio/fyne-cross:${FYNE_CROSS_VERSION}-freebsd fyneio/fyne-cross:${FYNE_CROSS_VERSION}-freebsd-amd64-$(tag) | ||
@docker tag fyneio/fyne-cross:${FYNE_CROSS_VERSION}-freebsd fyneio/fyne-cross:${FYNE_CROSS_VERSION}-freebsd-arm64-$(tag) | ||
# tag windows images | ||
@docker tag fyneio/fyne-cross:${FYNE_CROSS_VERSION}-windows fyneio/fyne-cross:${FYNE_CROSS_VERSION}-windows-$(tag) | ||
|
||
# push the latest images | ||
push-latest-images: | ||
@docker push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-base | ||
@docker push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-base-llvm | ||
@docker push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-base-freebsd | ||
@docker push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-android | ||
@docker push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-linux-386 | ||
@docker push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-linux-arm | ||
@docker push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-linux-arm64 | ||
@docker push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-freebsd-amd64 | ||
@docker push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-freebsd-arm64 | ||
@docker push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-windows | ||
|
||
# push the tagged images | ||
push-tag-images: | ||
@docker push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-base-$(tag) | ||
@docker push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-base-llvm-$(tag) | ||
@docker push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-base-freebsd-$(tag) | ||
@docker push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-android-$(tag) | ||
@docker push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-linux-386-$(tag) | ||
@docker push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-linux-arm-$(tag) | ||
@docker push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-linux-arm64-$(tag) | ||
@docker push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-freebsd-amd64-$(tag) | ||
@docker push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-freebsd-arm64-$(tag) | ||
@docker push fyneio/fyne-cross:${FYNE_CROSS_VERSION}-windows-$(tag) | ||
|
||
# push all images: latest and tagged | ||
push-images: push-latest-images push-tag-images | ||
|
||
embed: | ||
go run internal/cmd/embed/main.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
ARG FYNE_CROSS_VERSION | ||
FROM fyneio/fyne-cross:${FYNE_CROSS_VERSION}-base-llvm as pkg | ||
|
||
# Build pkg for linux | ||
# Based on https://github.com/freebsd/pkg/blob/release-1.12/.cirrus.yml#L19-L29 | ||
RUN apt-get update -qq \ | ||
&& apt-get install -y -q --no-install-recommends \ | ||
libsqlite3-dev \ | ||
libbsd-dev \ | ||
libarchive-dev \ | ||
libssl-dev \ | ||
liblzma-dev \ | ||
liblua5.2-dev \ | ||
nettle-dev \ | ||
liblzo2-dev \ | ||
libattr1-dev \ | ||
libacl1-dev \ | ||
build-essential \ | ||
zlib1g-dev \ | ||
libbz2-dev \ | ||
m4 \ | ||
libexpat1-dev \ | ||
liblz4-dev \ | ||
libxml2-dev \ | ||
libzstd-dev \ | ||
bsdtar \ | ||
&& apt-get -qy autoremove \ | ||
&& apt-get clean \ | ||
&& rm -r /var/lib/apt/lists/*; | ||
|
||
RUN mkdir -p /pkg-src \ | ||
&& mkdir -p /pkg/etc \ | ||
&& curl -L https://github.com/freebsd/pkg/archive/1.12.0.tar.gz | bsdtar -xf - -C /pkg-src \ | ||
&& cd /pkg-src/pkg-* \ | ||
&& ./scripts/install_deps.sh \ | ||
&& ./configure --with-libarchive.pc --prefix=/pkg \ | ||
&& make -j4 || make V=1 \ | ||
&& make install \ | ||
&& rm -rf /pkg-src | ||
|
||
FROM pkg as base-freebsd | ||
|
||
COPY --from=pkg /pkg /pkg | ||
|
||
ENV PATH=/pkg/sbin:${PATH} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
ARG LLVM_VERSION=12 | ||
ARG FYNE_CROSS_VERSION | ||
|
||
FROM fyneio/fyne-cross:${FYNE_CROSS_VERSION}-base | ||
ARG LLVM_VERSION | ||
|
||
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \ | ||
&& echo "deb http://apt.llvm.org/buster/ llvm-toolchain-buster-${LLVM_VERSION} main" | tee /etc/apt/sources.list.d/llvm.list > /dev/null \ | ||
&& apt-get update -qq \ | ||
&& apt-get install -y -q --no-install-recommends \ | ||
clang-${LLVM_VERSION} \ | ||
llvm-${LLVM_VERSION} \ | ||
lld-${LLVM_VERSION} \ | ||
&& apt-get -qy autoremove \ | ||
&& apt-get clean \ | ||
&& rm -r /var/lib/apt/lists/*; | ||
|
||
ENV PATH=/usr/lib/llvm-${LLVM_VERSION}/bin:${PATH} |
Oops, something went wrong.