kopia lustrzana https://github.com/Hamlib/Hamlib
Add support for the hamlib-base-image and hamlib-runtime targets
- support the arm64 and amd64 platforms on both a base-image and runtimepull/1639/head
rodzic
5028a0c440
commit
50e10f7582
|
@ -3,25 +3,24 @@ FROM ubuntu:latest AS hamlib-base-image
|
|||
|
||||
ENV DEBIAN_FRONTEND="noninteractive" TZ="Etc/UTC"
|
||||
|
||||
RUN apt-get update && apt-get install -y build-essential automake libtool python3 && rm -rf /var/lib/apt/lists/*
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y build-essential automake libtool python3.6 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Builder Image
|
||||
|
||||
FROM hamlib-base-image AS hamlib-builder
|
||||
|
||||
COPY . /tmp/build
|
||||
COPY . /wip
|
||||
|
||||
WORKDIR /tmp/build
|
||||
WORKDIR /wip
|
||||
|
||||
RUN mkdir -p /tmp/local
|
||||
|
||||
RUN ./bootstrap && ./configure --prefix=/tmp/local \
|
||||
&& make clean && make -j && make install
|
||||
RUN ./bootstrap && ./configure --prefix=/usr/local \
|
||||
&& make clean && make -j${nproc} && make install
|
||||
|
||||
# Runtime Image
|
||||
FROM ubuntu:latest AS hamlib-runtime
|
||||
|
||||
COPY --from=hamlib-builder /tmp/local/bin /usr/local/bin
|
||||
COPY --from=hamlib-builder /tmp/local/lib /usr/local/lib
|
||||
COPY --from=hamlib-builder /tmp/local/share /usr/local/share
|
||||
COPY --from=hamlib-builder /usr/local /usr/local
|
||||
|
||||
ENV LD_LIBRARY_PATH="/usr/local/lib"
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
|
||||
# Build the hamlib-runtime from the repository root
|
||||
|
||||
```
|
||||
docker buildx build \
|
||||
--platform linux/amd64,linux/arm64 \
|
||||
--target hamlib-runtime \
|
||||
-t hamlib-runtime \
|
||||
-f docker-build/Dockerfile \
|
||||
.
|
||||
```
|
||||
|
||||
# Interactively, develop with the hamlib-base-image
|
||||
|
||||
|
||||
## Support the linux/amd64 and linux/arm64 platforms
|
||||
```
|
||||
docker buildx build \
|
||||
--platform linux/amd64,linux/arm64 \
|
||||
--target hamlib-base-image \
|
||||
-t hamlib-base-image \
|
||||
-f docker-build/Dockerfile \
|
||||
.
|
||||
```
|
||||
|
||||
## Develop on the linux/amd64 hamlib-base-image
|
||||
|
||||
```
|
||||
docker run \
|
||||
-it \
|
||||
--rm \
|
||||
--platform linux/amd64 \
|
||||
-v $(pwd):/wip \
|
||||
-w /wip \
|
||||
-u $(id -u):$(id -g) \
|
||||
hamlib-base-image bash
|
||||
```
|
||||
|
||||
...or the linux/arm64 hamlib-base-image
|
||||
|
||||
```
|
||||
docker run \
|
||||
-it \
|
||||
--rm \
|
||||
--platform linux/arm64 \
|
||||
-v $(pwd):/wip \
|
||||
-w /wip \
|
||||
-u $(id -u):$(id -g) \
|
||||
hamlib-base-image bash
|
||||
```
|
||||
|
||||
# Run the linux/amd64 hamlib-runtime
|
||||
|
||||
```
|
||||
docker run \
|
||||
-it \
|
||||
--rm \
|
||||
--platform linux/amd64 \
|
||||
hamlib-runtime bash
|
||||
```
|
||||
|
||||
...or the linux/arm64 hamlib-runtime
|
||||
|
||||
```
|
||||
docker run \
|
||||
-it \
|
||||
--rm \
|
||||
--platform linux/arm64 \
|
||||
hamlib-runtime bash
|
||||
```
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
|
||||
# Build, execute from the repository root
|
||||
`docker buildx build --platform linux/amd64,linux/arm64 -t hamlib-runtime -f docker-build/Dockerfile .`
|
||||
|
||||
# Run the hamlib-runtime
|
||||
`docker run -it hamlib-runtime bash`
|
||||
|
Ładowanie…
Reference in New Issue