Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions native-image/micronaut-webserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ In this workshop you will:
./build-jar-eclipse-temurin.sh
```
Once the script finishes, a container image _eclipse-temurin-jar_ should be available.
Check its size. It should be **472MB**.
Check its size. It should be **472MB**.
```bash
docker images
```
Expand Down Expand Up @@ -549,7 +549,7 @@ A separate Maven profile exists for this step:
#### For Local Building

If you build a native image locally, it requires the `musl` toolchain with `zlib` installed on your machine.
We provide a script to download and configure the `musl` toolchain, and install `zlib` into the toolchain:
We provide a script to download and configure the `musl` toolchain:
```bash
./setup-musl.sh
```
Expand Down
38 changes: 6 additions & 32 deletions native-image/micronaut-webserver/setup-musl.sh
Original file line number Diff line number Diff line change
@@ -1,36 +1,10 @@
#!/usr/bin/env bash
set +e

# Specify an installation directory for musl:
export MUSL_HOME=$PWD/musl-toolchain
# Download the `musl` toolchain that includes the `zlib` library.
# Extract it, and add to the system path:

# Download musl sources:
curl -O https://musl.libc.org/releases/musl-1.2.5.tar.gz

# Build musl from source
tar -xzvf musl-1.2.5.tar.gz
rm -rf musl-1.2.5.tar.gz
pushd musl-1.2.5
./configure --prefix=$MUSL_HOME --static
# The next operation may require privileged access to system resources, so use sudo
sudo make
sudo make install
popd

# Install a symlink for use by native-image
ln -s $MUSL_HOME/bin/musl-gcc $MUSL_HOME/bin/x86_64-linux-musl-gcc

# Extend the system path and confirm that musl is available by printing its version
export PATH="$MUSL_HOME/bin:$PATH"
x86_64-linux-musl-gcc --version

# Download zlib sources:
curl -O https://zlib.net/fossils/zlib-1.2.13.tar.gz

# Build zlib with musl from source and install into the MUSL_HOME directory
tar -xzvf zlib-1.2.13.tar.gz
rm -rf zlib-1.2.13.tar.gz
pushd zlib-1.2.13
CC=musl-gcc ./configure --prefix=$MUSL_HOME --static
make && make install
popd
curl -SLO https://gds.oracle.com/download/bfs/archive/musl-toolchain-1.2.5-oracle-00001-linux-amd64.tar.gz
tar xzf musl-toolchain-1.2.5-oracle-00001-linux-amd64.tar.gz
export PATH="$(pwd)/musl-toolchain/bin:$PATH"
rm -rf musl-toolchain-1.2.5-oracle-00001-linux-amd64.tar.gz
2 changes: 1 addition & 1 deletion native-image/spring-boot-webserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ A separate Maven profile exists for this step:
#### For Local Building

If you build a native image locally, it requires the `musl` toolchain with `zlib` installed on your machine.
We provide a script to download and configure the `musl` toolchain, and install `zlib` into the toolchain:
We provide a script to download and configure the `musl` toolchain:
```bash
./setup-musl.sh
```
Expand Down
39 changes: 8 additions & 31 deletions native-image/spring-boot-webserver/setup-musl.sh
Original file line number Diff line number Diff line change
@@ -1,36 +1,13 @@
#!/usr/bin/env bash
set +e

# Specify an installation directory for musl:
export MUSL_HOME=$PWD/musl-toolchain

# Download musl sources:
curl -O https://musl.libc.org/releases/musl-1.2.5.tar.gz

# Build musl from source
tar -xzvf musl-1.2.5.tar.gz
rm -rf musl-1.2.5.tar.gz
pushd musl-1.2.5
./configure --prefix=$MUSL_HOME --static
# The next operation may require privileged access to system resources, so use sudo
sudo make
sudo make install
popd

# Install a symlink for use by native-image
ln -s $MUSL_HOME/bin/musl-gcc $MUSL_HOME/bin/x86_64-linux-musl-gcc

# Extend the system path and confirm that musl is available by printing its version
export PATH="$MUSL_HOME/bin:$PATH"
x86_64-linux-musl-gcc --version
#!/usr/bin/env bash
set +e

# Download zlib sources:
curl -O https://zlib.net/fossils/zlib-1.2.13.tar.gz
# Download the `musl` toolchain that includes the `zlib` library.
# Extract it, and add to the system path:

# Build zlib with musl from source and install into the MUSL_HOME directory
tar -xzvf zlib-1.2.13.tar.gz
rm -rf zlib-1.2.13.tar.gz
pushd zlib-1.2.13
CC=musl-gcc ./configure --prefix=$MUSL_HOME --static
make && make install
popd
curl -SLO https://gds.oracle.com/download/bfs/archive/musl-toolchain-1.2.5-oracle-00001-linux-amd64.tar.gz
tar xzf musl-toolchain-1.2.5-oracle-00001-linux-amd64.tar.gz
export PATH="$(pwd)/musl-toolchain/bin:$PATH"
rm -rf musl-toolchain-1.2.5-oracle-00001-linux-amd64.tar.gz