Skip to content
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

Installation issue in docker image #123

Open
onur-yildirim-infinitusai opened this issue Mar 28, 2024 · 1 comment
Open

Installation issue in docker image #123

onur-yildirim-infinitusai opened this issue Mar 28, 2024 · 1 comment

Comments

@onur-yildirim-infinitusai
Copy link

onur-yildirim-infinitusai commented Mar 28, 2024

I am trying to use Azure Speech SDK for golang and this is my DockerFile but I am getting error above.
I dont know if the install guide is up-to-date
I saw it doesn't work for Debian 12, can it be the reason?

The uname-sp gives me this architecture and platform values:
Linux x86_64 and

PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: /tmp/go-link-204386385/000001.o: in function `_cgo_c009bcede03b_Cfunc_audio_config_create_audio_input_from_a_microphone':
audio_config.cgo2.c:(.text+0x69): undefined reference to `audio_config_create_audio_input_from_a_microphone'
/usr/bin/ld: /tmp/go-link-204386385/000001.o: in function `_cgo_c009bcede03b_Cfunc_audio_config_create_audio_input_from_default_microphone':
audio_config.cgo2.c:(.text+0xb5): undefined reference to `audio_config_create_audio_input_from_default_microphone'
/usr/bin/ld: /tmp/go-link-204386385/000001.o: in function `_cgo_c009bcede03b_Cfunc_audio_config_create_audio_input_from_stream':
audio_config.cgo2.c:(.text+0x10c): undefined reference to `audio_config_create_audio_input_from_stream'
/usr/bin/ld: /tmp/go-link-204386385/000001.o: in function `_cgo_c009bcede03b_Cfunc_audio_config_create_audio_input_from_wav_file_name':
audio_config.cgo2.c:(.text+0x163): undefined reference to `audio_config_create_audio_input_from_wav_file_name'

# Use the official Go image as the base image
FROM golang:1.19
RUN apt-get update
RUN apt-get install -y build-essential libssl-dev ca-certificates libasound2 wget

RUN echo $(arch) : $(uname -m)

ENV HOME /root
ENV SPEECHSDK_ROOT="$HOME/speechsdk"
RUN mkdir -p "$SPEECHSDK_ROOT"

# Download and extract Speech SDK
RUN wget -O SpeechSDK-Linux.tar.gz https://aka.ms/csspeech/linuxbinary \
    && tar --strip 1 -xzf SpeechSDK-Linux.tar.gz -C "$SPEECHSDK_ROOT" \
    && rm SpeechSDK-Linux.tar.gz

RUN echo $(ls -l "$SPEECHSDK_ROOT/lib")

ENV CGO_CFLAGS="-I$SPEECHSDK_ROOT/include/c_api"
ENV CGO_LDFLAGS="-L$SPEECHSDK_ROOT/lib/x64-lMicrosoft.CognitiveServices.Speech.core"
ENV LD_LIBRARY_PATH="$SPEECHSDK_ROOT/lib/x64:$LD_LIBRARY_PATH"

RUN echo $(go env)

# Set the working directory inside the container
WORKDIR /app

COPY go.mod go.sum ./

RUN go mod download

COPY *.go ./

# Build the Go application
RUN go build -o /main 

# Run the Go application
CMD ["/main"]
@onur-yildirim-infinitusai onur-yildirim-infinitusai changed the title Having issue in a docker container Installation issue in docker image Mar 28, 2024
@zxxshaycormac
Copy link

根本没有linux_amd64文件夹,微软给的依赖文件夹里面只有x86和x64,你需要修改成x64,改了就行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants